From a3a4244f21472fd42490575a6a01a1f76d264ca9 Mon Sep 17 00:00:00 2001 From: ping Date: Wed, 17 May 2023 00:29:13 +0800 Subject: [PATCH] [mod_sofia] fix sofia_glue_get_extra_headers memory leak --- src/mod/endpoints/mod_sofia/sofia_glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 8c9dfcc57a..0eb0dcf601 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -929,9 +929,9 @@ char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix if ( !exclude_regex || !(/*proceed*/ switch_regex_perform(name, exclude_regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) { const char *hname = name + strlen(prefix); stream.write_function(&stream, "%s: %s\r\n", hname, value); - switch_regex_safe_free(re); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Ignoring Extra Header [%s] , matches exclude_outgoing_extra_header [%s]\n", name, exclude_regex); + switch_regex_safe_free(re); } } }