Module: kamailio
Branch: master
Commit: 5a18155c0fe661e7488f75afa7b0ea7638932943
URL:
https://github.com/kamailio/kamailio/commit/5a18155c0fe661e7488f75afa7b0ea7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-10-08T12:31:39+02:00
avp: free allocated variable in case of error
---
Modified: src/modules/avp/avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5a18155c0fe661e7488f75afa7b0ea7…
Patch:
https://github.com/kamailio/kamailio/commit/5a18155c0fe661e7488f75afa7b0ea7…
---
diff --git a/src/modules/avp/avp.c b/src/modules/avp/avp.c
index f597086d92..f11d56baeb 100644
--- a/src/modules/avp/avp.c
+++ b/src/modules/avp/avp.c
@@ -1380,7 +1380,7 @@ static int attr_hdr_body2attrs2(struct sip_msg* msg, char* header_,
char* prefix
static int attr_hdr_body2attrs_fixup(void **param, int param_no)
{
char *c, *params;
- hdr_name_t *h;
+ hdr_name_t *h = NULL;
int n;
str *s;
if(param_no == 1) {
@@ -1427,6 +1427,7 @@ static int attr_hdr_body2attrs_fixup(void **param, int param_no)
LOG(L_ERR, "attr_hdr_body2attrs_fixup: bad field param "
"modifier near '%s'\n",
params);
+ pkg_free(h);
return E_CFG;
}
params++;
@@ -1434,6 +1435,7 @@ static int attr_hdr_body2attrs_fixup(void **param, int param_no)
if(!h->val_types) {
LOG(L_ERR, "attr_hdr_body2attrs_fixup: no field param modifier "
"specified\n");
+ pkg_free(h);
return E_CFG;
}
} else {