Skip to content

Commit

Permalink
siputils: free params for contact param decode and remove
Browse files Browse the repository at this point in the history
(cherry picked from commit d6504e2)
  • Loading branch information
miconda committed Feb 8, 2021
1 parent dbe358d commit 218350f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/siputils/contact_ops.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -1004,6 +1009,7 @@ int ki_contact_param_rm(sip_msg_t *msg, str *nparam)
continue;
}
free_params(params);
params = NULL;
}

return 1;
Expand Down

0 comments on commit 218350f

Please sign in to comment.