]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/EfiRom/EfiRom.c
BaseTools/EfiRom: Fix file handles not being closed
[mirror_edk2.git] / BaseTools / Source / C / EfiRom / EfiRom.c
index 2e513156001298ce3516d4d32e4c84aa99e7d744..c58c1523e95a5368db4f43217219399faaa71534 100644 (file)
@@ -176,9 +176,6 @@ Returns:
 \r
 BailOut:\r
   if (Status == STATUS_SUCCESS) {\r
-    if (FptrOut != NULL) {\r
-      fclose (FptrOut);\r
-    }\r
     //\r
     // Clean up our file list\r
     //\r
@@ -189,6 +186,10 @@ BailOut:
     }\r
   }\r
 \r
+  if (FptrOut != NULL) {\r
+    fclose (FptrOut);\r
+  }\r
+\r
   if (mOptions.Verbose) {\r
     VerboseMsg("%s tool done with return code is 0x%x.\n", UTILITY_NAME, GetUtilityStatus ());\r
   }\r