]> 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:29:21 +0000 (18:29 +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 79458d70ebe96ea2a1f20a52d206515a4ffe6574)

main/config.c

index ea553106c96213145903eaed96dcf7c107d9fffc..858c6dab4d8e0aabec91207e8f203990fdc7af5f 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;
                }