Avoid leaking `romdir` file handle

This commit is contained in:
Moshe Kaplan 2014-07-23 11:42:05 -04:00
parent 8a43789db5
commit f1d5a0a1b3
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,8 @@ int main(int argc, char *argv[]) {
extinfo = fopen("EXTINFO", "wb"); extinfo = fopen("EXTINFO", "wb");
if (extinfo == NULL) { if (extinfo == NULL) {
/* Don't leak the opened romdir */
fclose(romdir);
printf("failed to create EXTINFO\n"); printf("failed to create EXTINFO\n");
return 1; return 1;
} }