Skip to content

Commit

Permalink
mi_html: fix improper free on error
Browse files Browse the repository at this point in the history
Fixes Coverity CID #200040
  • Loading branch information
razvancrainea committed Jul 10, 2020
1 parent 395bfdc commit 5fea3d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/mi_html/http_fnc.c
Expand Up @@ -472,6 +472,9 @@ mi_response_t *mi_http_run_mi_cmd(int mod, int cmd, const str* arg,
mi_request_t req_item;
mi_response_t *resp = NULL;

/* initialize field to make sure it is not released in case of errors */
req_item.req_obj = NULL;

if (mod<0 && cmd<0) {
LM_ERR("Incorect params: mod=[%d], cmd=[%d]\n", mod, cmd);
goto error;
Expand Down

0 comments on commit 5fea3d3

Please sign in to comment.