diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-10-07 11:09:44 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-10-07 11:09:44 -0700 |
commit | ff32f542c94f1b30ba2ba58193adb3774a5c50e6 (patch) | |
tree | 915580608db482253138f3a1405ed17117426ef7 /listing.c | |
parent | 1f1ea56ca22a85164c4362650b004e202f4007fd (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>
Diffstat (limited to 'listing.c')
-rw-r--r-- | listing.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -494,5 +494,9 @@ GenerateListing(const char *out_name) } warningLevel = oldWarningLevel; } + if (outFile != stdout) + { + fclose(outFile); + } return 1; } |