[CABMAN] Fix 2 handle leaks, in case of error (#2044)

CORE-11090
This commit is contained in:
Serge Gautherie 2019-11-27 01:49:08 +01:00 committed by Hermès BÉLUSCA - MAÏTO
parent c741b1c185
commit f5b10b4d0d

View file

@ -414,6 +414,7 @@ bool CCabinet::SetCabinetReservedFile(char* FileName)
if (CabinetReservedFileSize == (ULONG)-1) if (CabinetReservedFileSize == (ULONG)-1)
{ {
DPRINT(MIN_TRACE, ("Cannot read from cabinet reserved file.\n")); DPRINT(MIN_TRACE, ("Cannot read from cabinet reserved file.\n"));
fclose(FileHandle);
return false; return false;
} }
@ -1761,6 +1762,7 @@ bool CCabinet::CreateSimpleCabinet()
if(Status != CAB_STATUS_SUCCESS) if(Status != CAB_STATUS_SUCCESS)
{ {
DPRINT(MIN_TRACE, ("Cannot add file to cabinet (%u).\n", (UINT)Status)); DPRINT(MIN_TRACE, ("Cannot add file to cabinet (%u).\n", (UINT)Status));
FindClose(hFind);
goto cleanup; goto cleanup;
} }
} }