BaseTools/LzmaCompress: Fix file handles not being closed

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hao Wu 2016-10-11 15:51:09 +08:00
parent 181c955937
commit 1880d5e4d0
1 changed files with 3 additions and 1 deletions

View File

@ -329,8 +329,10 @@ int main2(int numArgs, const char *args[], char *rs)
if (InFile_Open(&inStream.file, inputFile) != 0)
return PrintError(rs, "Can not open input file");
if (OutFile_Open(&outStream.file, outputFile) != 0)
if (OutFile_Open(&outStream.file, outputFile) != 0) {
File_Close(&inStream.file);
return PrintError(rs, "Can not open output file");
}
File_GetLength(&inStream.file, &fileSize);