Skip to content

Commit

Permalink
[mod_verto] Fix memory leak by correctly freeing regex
Browse files Browse the repository at this point in the history
For mod_verto regex was never freed and was actually leaking memory.
Correctly free the compiled regex to fix the memory leak.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel committed Nov 3, 2023
1 parent 57fe9aa commit 2a4c882
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mod/endpoints/mod_verto/mod_verto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1893,10 +1893,12 @@ static void http_run(jsock_t *jsock)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"%d request [%s] matched expr [%s]\n", proceed, request->uri, expression);
request->uri = rule->value;
switch_regex_safe_free(re);
break;
}

rule = rule->next;
switch_regex_safe_free(re);
}
}

Expand Down

0 comments on commit 2a4c882

Please sign in to comment.