[sr-dev] git:master:3ca68d12: Merge pull request #1435 from kamailio/cchance/presence

GitHub noreply at github.com
Fri Feb 9 16:02:47 CET 2018


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

Author: Charles Chance <charles.chance at sipcentric.com>
Committer: GitHub <noreply at github.com>
Date: 2018-02-09T15:02:42Z

Merge pull request #1435 from kamailio/cchance/presence

presence: delay freeing generated etag string

---

Modified: src/modules/presence/presentity.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3ca68d1246b801f37054c965eac8a24bda89b325.diff
Patch: https://github.com/kamailio/kamailio/commit/3ca68d1246b801f37054c965eac8a24bda89b325.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