Module: kamailio
Branch: 5.4
Commit: 218350f089be9c3b5505079079df63d25dd74cc4
URL:
https://github.com/kamailio/kamailio/commit/218350f089be9c3b5505079079df63d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-02-08T12:04:38+01:00
siputils: free params for contact param decode and remove
(cherry picked from commit d6504e28f7fef8d48480861ea12e9bd457288661)
---
Modified: src/modules/siputils/contact_ops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/218350f089be9c3b5505079079df63d…
Patch:
https://github.com/kamailio/kamailio/commit/218350f089be9c3b5505079079df63d…
---
diff --git a/src/modules/siputils/contact_ops.c b/src/modules/siputils/contact_ops.c
index a299db32e5..f21d7705b3 100644
--- a/src/modules/siputils/contact_ops.c
+++ b/src/modules/siputils/contact_ops.c
@@ -773,6 +773,7 @@ int ki_contact_param_decode(sip_msg_t *msg, str *nparam)
}
if(pit==NULL || pit->body.len<=0) {
free_params(params);
+ params = NULL;
continue;
}
@@ -816,6 +817,8 @@ int ki_contact_param_decode(sip_msg_t *msg, str *nparam)
pkg_free(nval.s);
return -2;
}
+ free_params(params);
+ params = NULL;
}
return 1;
@@ -974,6 +977,7 @@ int ki_contact_param_rm(sip_msg_t *msg, str *nparam)
}
if(pit==NULL) {
free_params(params);
+ params = NULL;
continue;
}
rms.s = pit->name.s;
@@ -984,6 +988,7 @@ int ki_contact_param_rm(sip_msg_t *msg, str *nparam)
LM_ERR("failed to find start of the parameter delimiter [%.*s]\n",
c->uri.len, c->uri.s);
free_params(params);
+ params = NULL;
continue;
}
if(pit->body.len>0) {
@@ -1004,6 +1009,7 @@ int ki_contact_param_rm(sip_msg_t *msg, str *nparam)
continue;
}
free_params(params);
+ params = NULL;
}
return 1;