[sr-dev] git:master:ae7dce43: utils: handle error case for xcap auth status to free allocated structs
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jul 20 09:32:10 CEST 2017
Module: kamailio
Branch: master
Commit: ae7dce434e10ef570e1c6daa8ca5d9f800239ddf
URL: https://github.com/kamailio/kamailio/commit/ae7dce434e10ef570e1c6daa8ca5d9f800239ddf
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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/ae7dce434e10ef570e1c6daa8ca5d9f800239ddf.diff
Patch: https://github.com/kamailio/kamailio/commit/ae7dce434e10ef570e1c6daa8ca5d9f800239ddf.patch
---
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;
}
More information about the sr-dev
mailing list