From 010b00a015a77b3bb29f33025f58a8d628bc907d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 3 Sep 2022 05:24:54 +0300 Subject: [PATCH 48/48] Stop inf file recursing to already closed including file See osdn #45418 Signed-off-by: Marko Lindqvist --- utility/inputfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utility/inputfile.c b/utility/inputfile.c index 776abc7193..3a9c1b91b3 100644 --- a/utility/inputfile.c +++ b/utility/inputfile.c @@ -302,11 +302,15 @@ void inf_close(struct inputfile *inf) inf_sanity_check(inf); log_debug("inputfile: closing \"%s\"", inf_filename(inf)); + if (inf->included_from) { inf_close(inf->included_from); + /* Stop anything from recursing to already closed including file */ + inf->included_from = NULL; } inf_close_partial(inf); free(inf); + log_debug("inputfile: closed ok"); } -- 2.35.1