summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-10-07 11:09:44 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-10-07 11:09:44 -0700
commitff32f542c94f1b30ba2ba58193adb3774a5c50e6 (patch)
tree915580608db482253138f3a1405ed17117426ef7
parent1f1ea56ca22a85164c4362650b004e202f4007fd (diff)
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 <alan.coopersmith@oracle.com>
-rw-r--r--listing.c4
1 files changed, 4 insertions, 0 deletions
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;
}