Module: kamailio
Branch: 5.2
Commit: 9230834aec2de5a078c0a4a81f33bd5483729898
URL:
https://github.com/kamailio/kamailio/commit/9230834aec2de5a078c0a4a81f33bd5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-10-09T19:37:42+02:00
avp: free allocated variable in case of error
(cherry picked from commit 5a18155c0fe661e7488f75afa7b0ea7638932943)
(cherry picked from commit fc9ca0fcdff7ebc5399374038bc6a0aa02207229)
---
Modified: src/modules/avp/avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9230834aec2de5a078c0a4a81f33bd5…
Patch:
https://github.com/kamailio/kamailio/commit/9230834aec2de5a078c0a4a81f33bd5…
---
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 {