From f1d5a0a1b3f3f55c4101517c9cc9aa45575d173d Mon Sep 17 00:00:00 2001 From: Moshe Kaplan Date: Wed, 23 Jul 2014 11:42:05 -0400 Subject: [PATCH] Avoid leaking `romdir` file handle --- fps2bios/romdir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fps2bios/romdir.c b/fps2bios/romdir.c index 4b92135ad1..2e9f4c3ff7 100644 --- a/fps2bios/romdir.c +++ b/fps2bios/romdir.c @@ -38,6 +38,8 @@ int main(int argc, char *argv[]) { extinfo = fopen("EXTINFO", "wb"); if (extinfo == NULL) { + /* Don't leak the opened romdir */ + fclose(romdir); printf("failed to create EXTINFO\n"); return 1; }