Module: kamailio
Branch: master
Commit: 34749ab13b31504358761c964f794b283931394c
URL:
https://github.com/kamailio/kamailio/commit/34749ab13b31504358761c964f794b2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-22T11:01:16+02:00
utils: jump to error on pkg allocation failure
---
Modified: src/modules/utils/xcap_auth.c
---
Diff:
https://github.com/kamailio/kamailio/commit/34749ab13b31504358761c964f794b2…
Patch:
https://github.com/kamailio/kamailio/commit/34749ab13b31504358761c964f794b2…
---
diff --git a/src/modules/utils/xcap_auth.c b/src/modules/utils/xcap_auth.c
index 3824b2d484a..5c986a18cd3 100644
--- a/src/modules/utils/xcap_auth.c
+++ b/src/modules/utils/xcap_auth.c
@@ -418,11 +418,13 @@ int get_rules_doc(str *user, str *domain, int type, str
**rules_doc)
doc = (str *)pkg_malloc(sizeof(str));
if(doc == NULL) {
PKG_MEM_ERROR;
+ goto error;
}
doc->s = (char *)pkg_malloc(body.len * sizeof(char));
if(doc->s == NULL) {
pkg_free(doc);
PKG_MEM_ERROR;
+ goto error;
}
memcpy(doc->s, body.s, body.len);
doc->len = body.len;
@@ -514,4 +516,4 @@ int w_xcap_auth_status(struct sip_msg *_msg, char *_sp1, char *_sp2)
}
return ki_xcap_auth_status(_msg, &watcher_uri, &presentity_uri);
-}
\ No newline at end of file
+}