[mod_verto] Fix memory leak by correctly freeing regex

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>
This commit is contained in:
Christian Marangi 2023-11-03 17:27:06 +01:00 committed by Andrey Volk
parent e490fe6d7d
commit 12b47fe7f9
1 changed files with 2 additions and 0 deletions

View File

@ -1893,10 +1893,12 @@ authed:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"%d request [%s] matched expr [%s]\n", proceed, request->uri, expression); "%d request [%s] matched expr [%s]\n", proceed, request->uri, expression);
request->uri = rule->value; request->uri = rule->value;
switch_regex_safe_free(re);
break; break;
} }
rule = rule->next; rule = rule->next;
switch_regex_safe_free(re);
} }
} }