]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/LzmaCompress/LzmaCompress.c
BaseTools/LzmaCompress: Fix file handles not being closed
[mirror_edk2.git] / BaseTools / Source / C / LzmaCompress / LzmaCompress.c
index aff0bed2c80830c118af1fc69ff8c5cbb99a5562..be8790219699279ce831029d28b616eedfcce91f 100644 (file)
@@ -329,8 +329,10 @@ int main2(int numArgs, const char *args[], char *rs)
   if (InFile_Open(&inStream.file, inputFile) != 0)\r
     return PrintError(rs, "Can not open input file");\r
 \r
-  if (OutFile_Open(&outStream.file, outputFile) != 0)\r
+  if (OutFile_Open(&outStream.file, outputFile) != 0) {\r
+    File_Close(&inStream.file);\r
     return PrintError(rs, "Can not open output file");\r
+  }\r
 \r
   File_GetLength(&inStream.file, &fileSize);\r
 \r