From ff32f542c94f1b30ba2ba58193adb3774a5c50e6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 7 Oct 2023 11:09:44 -0700 Subject: GenerateListing: close outFile before returning Found by Oracle Parfait static analyzer: Error: File Leak File Leak [file-ptr-leak]: Leaked File outFile at line 497 of app/xkbcomp/listing.c in function 'GenerateListing'. outFile initialized at line 432 with fopen Signed-off-by: Alan Coopersmith --- listing.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/listing.c b/listing.c index e5bca89..fcf23d3 100644 --- a/listing.c +++ b/listing.c @@ -494,5 +494,9 @@ GenerateListing(const char *out_name) } warningLevel = oldWarningLevel; } + if (outFile != stdout) + { + fclose(outFile); + } return 1; } -- cgit v1.2.3