[sr-dev] git:master:fab3f881: presence: delay freeing generated etag string

Charles Chance charles.chance at sipcentric.com
Fri Feb 9 16:02:46 CET 2018


Module: kamailio
Branch: master
Commit: fab3f881634b1233e6c5446ffafbd30ab07c0bc6
URL: https://github.com/kamailio/kamailio/commit/fab3f881634b1233e6c5446ffafbd30ab07c0bc6

Author: Charles Chance <charles.chance at sipcentric.com>
Committer: Charles Chance <charles.chance at sipcentric.com>
Date: 2018-02-09T09:37:24Z

presence: delay freeing generated etag string

- it may still be needed for replication

---

Modified: src/modules/presence/presentity.c

---

Diff:  https://github.com/kamailio/kamailio/commit/fab3f881634b1233e6c5446ffafbd30ab07c0bc6.diff
Patch: https://github.com/kamailio/kamailio/commit/fab3f881634b1233e6c5446ffafbd30ab07c0bc6.patch

---

diff --git a/src/modules/presence/presentity.c b/src/modules/presence/presentity.c
index 1c7c4240b9..514e89036c 100644
--- a/src/modules/presence/presentity.c
+++ b/src/modules/presence/presentity.c
@@ -1100,10 +1100,6 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
 				}
 				if (sent_reply) *sent_reply= 1;
 
-				if(etag.s)
-					pkg_free(etag.s);
-				etag.s= NULL;
-
 				goto done;
 			}
 		}
@@ -1232,10 +1228,6 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
 		}
 		if (sent_reply) *sent_reply= 1;
 
-		if(etag.s)
-			pkg_free(etag.s);
-		etag.s= NULL;
-
 		if(!body)
 			goto done;
 	}
@@ -1266,6 +1258,10 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
 		pres_dmq_replicate_presentity(presentity, body, new_t, &cur_etag, sphere, &p_ruid, NULL);
 	}
 
+	if(etag.s)
+		pkg_free(etag.s);
+	etag.s= NULL;
+
 	if(cur_ruid.s)
 		pkg_free(cur_ruid.s);
 	cur_ruid.s= NULL;




More information about the sr-dev mailing list