]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] Fix memory leak by correctly freeing regex 2642/head
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 3 Nov 2023 16:27:06 +0000 (17:27 +0100)
committerAndrey Volk <andywolk@gmail.com>
Wed, 11 Dec 2024 13:02:45 +0000 (16:02 +0300)
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>
src/mod/endpoints/mod_verto/mod_verto.c

index 48c40527b5602d9cdc8cc1032858d678f31d152b..36aba6db5e29d0dbb7f43310217119739fe0ab7f 100644 (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);
                }
        }