From: Andrey Volk Date: Wed, 2 Jun 2021 22:31:09 +0000 (+0300) Subject: [mod_blacklist] Fix use after free(). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fblacklist;p=thirdparty%2Ffreeswitch.git [mod_blacklist] Fix use after free(). --- diff --git a/src/mod/applications/mod_blacklist/mod_blacklist.c b/src/mod/applications/mod_blacklist/mod_blacklist.c index ce5d5a5c03..4a9514a277 100644 --- a/src/mod/applications/mod_blacklist/mod_blacklist.c +++ b/src/mod/applications/mod_blacklist/mod_blacklist.c @@ -99,7 +99,7 @@ static switch_status_t load_list(const char *name, const char *filename) switch_core_hash_insert(bl->list, buf, (void *)SWITCH_TRUE); } - switch_core_hash_insert(globals.files, name, filename); + switch_core_hash_insert_auto_free(globals.files, name, strdup(filename)); switch_core_hash_insert(globals.lists, name, bl); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Loaded list [%s]\n", name);