Module: kamailio
Branch: master
Commit: d72a3fbc903da02ae3b26f3aae2ea228c9f8b255
URL:
https://github.com/kamailio/kamailio/commit/d72a3fbc903da02ae3b26f3aae2ea22…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-29T10:15:21+02:00
siputils: free head of params list for get_uri_param()
- GH #3857
---
Modified: src/modules/siputils/checks.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d72a3fbc903da02ae3b26f3aae2ea22…
Patch:
https://github.com/kamailio/kamailio/commit/d72a3fbc903da02ae3b26f3aae2ea22…
---
diff --git a/src/modules/siputils/checks.c b/src/modules/siputils/checks.c
index 6cc977197fb..4e28aef8e8d 100644
--- a/src/modules/siputils/checks.c
+++ b/src/modules/siputils/checks.c
@@ -1165,6 +1165,7 @@ int get_uri_param(struct sip_msg *_msg, char *_param, char *_value)
pv_value_t val;
param_hooks_t hooks;
+ param_t *list = NULL;
param_t *params;
param = (str *)_param;
@@ -1177,11 +1178,12 @@ int get_uri_param(struct sip_msg *_msg, char *_param, char
*_value)
t = _msg->parsed_uri.params;
- if(parse_params(&t, CLASS_ANY, &hooks, ¶ms) < 0) {
+ if(parse_params(&t, CLASS_ANY, &hooks, &list) < 0) {
LM_ERR("ruri parameter parsing failed\n");
return -1;
}
+ params = list;
while(params) {
if((params->name.len == param->len)
&& (strncmp(params->name.s, param->s, param->len) == 0)) {
@@ -1196,11 +1198,11 @@ int get_uri_param(struct sip_msg *_msg, char *_param, char
*_value)
}
}
- free_params(params);
+ free_params(list);
return -1;
found:
- free_params(params);
+ free_params(list);
return 1;
}