]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
config.c: #include of non-existent file should not crash
authorAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Mon, 3 Mar 2025 14:53:02 +0000 (09:53 -0500)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 20 Mar 2025 18:18:29 +0000 (18:18 +0000)
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 eec9bed8af075d4be91da4c0d7c8a64128c27f5a)

main/config.c

index 05337eaa19fbfc5d70301abb5f76a438a5e97fb1..900efa355a3e1b06dd284a048952542d9ddd996f 100644 (file)
@@ -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;
                }