From: Allan Nathanson <42244061+Allan-N@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:53:02 +0000 (-0500) Subject: config.c: #include of non-existent file should not crash X-Git-Tag: 21.8.0-rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=245a36c93d524d23822a1a98a62de7a3706289e9;p=thirdparty%2Fasterisk.git config.c: #include of non-existent file should not crash Corrects a segmentation fault when a configuration file has a #include statement that referenced a file that does not exist. Resolves: https://github.com/asterisk/asterisk/issues/1139 (cherry picked from commit 79458d70ebe96ea2a1f20a52d206515a4ffe6574) --- diff --git a/main/config.c b/main/config.c index ea553106c9..858c6dab4d 100644 --- a/main/config.c +++ b/main/config.c @@ -2232,7 +2232,6 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat, } if (!result && (include_type != CONFIG_STATEMENT_TRYINCLUDE)) { ast_log(LOG_ERROR, "The file '%s' was listed as a #include but it does not exist.\n", cur); - ast_include_destroy(newinclude); return -1; }