[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
parent ee7c7dea60
commit 83b38714b9
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
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,
"%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);
}
}