Module: kamailio
Branch: master
Commit: 97ac3b910dc955058fa4c08ad22ac01a4f31fe74
URL:
https://github.com/kamailio/kamailio/commit/97ac3b910dc955058fa4c08ad22ac01…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-04T12:26:41+02:00
presence: reset vars to avoid double free in case of error
---
Modified: src/modules/presence/presentity.c
---
Diff:
https://github.com/kamailio/kamailio/commit/97ac3b910dc955058fa4c08ad22ac01…
Patch:
https://github.com/kamailio/kamailio/commit/97ac3b910dc955058fa4c08ad22ac01…
---
diff --git a/src/modules/presence/presentity.c b/src/modules/presence/presentity.c
index 9755c4f0e9..e3246e2133 100644
--- a/src/modules/presence/presentity.c
+++ b/src/modules/presence/presentity.c
@@ -1148,9 +1148,12 @@ int update_presentity(struct sip_msg* msg, presentity_t*
presentity, str* body,
if(rules_doc->s)
pkg_free(rules_doc->s);
pkg_free(rules_doc);
+ rules_doc = NULL;
}
- if(pres_uri.s)
+ if(pres_uri.s) {
pkg_free(pres_uri.s);
+ pres_uri.s = NULL;
+ }
if (pa_dbf.end_transaction)
{
@@ -1189,7 +1192,6 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity,
str* body,
}
if(pres_uri.s) {
pkg_free(pres_uri.s);
- pres_uri.s = NULL;
}
if (pa_dbf.abort_transaction) {