Module: kamailio
Branch: master
Commit: ae7dce434e10ef570e1c6daa8ca5d9f800239ddf
URL:
https://github.com/kamailio/kamailio/commit/ae7dce434e10ef570e1c6daa8ca5d9f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-20T09:31:49+02:00
utils: handle error case for xcap auth status to free allocated structs
---
Modified: src/modules/utils/xcap_auth.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ae7dce434e10ef570e1c6daa8ca5d9f…
Patch:
https://github.com/kamailio/kamailio/commit/ae7dce434e10ef570e1c6daa8ca5d9f…
---
diff --git a/src/modules/utils/xcap_auth.c b/src/modules/utils/xcap_auth.c
index 9455052d98..425fa105cd 100644
--- a/src/modules/utils/xcap_auth.c
+++ b/src/modules/utils/xcap_auth.c
@@ -465,6 +465,12 @@ int ki_xcap_auth_status(sip_msg_t* _msg, str* watcher_uri, str*
presentity_uri)
res = get_rules_doc(&uri.user, &uri.host, PRES_RULES, &rules_doc);
if ((res < 0) || (rules_doc == NULL) || (rules_doc->s == NULL)) {
LM_DBG("no xcap rules doc found for presentity uri\n");
+ if(rules_doc) {
+ if(rules_doc->s) {
+ pkg_free(rules_doc->s);
+ }
+ pkg_free(rules_doc);
+ }
return PENDING_STATUS;
}