Module: kamailio
Branch: master
Commit: 3ca68d1246b801f37054c965eac8a24bda89b325
URL:
https://github.com/kamailio/kamailio/commit/3ca68d1246b801f37054c965eac8a24…
Author: Charles Chance <charles.chance(a)sipcentric.com>
Committer: GitHub <noreply(a)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/3ca68d1246b801f37054c965eac8a24…
Patch:
https://github.com/kamailio/kamailio/commit/3ca68d1246b801f37054c965eac8a24…
---
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;