https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f5b10b4d0d857bdd2af9e…
commit f5b10b4d0d857bdd2af9e09257b2b7e56f51709c
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Wed Nov 27 01:49:08 2019 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Nov 27 01:49:08 2019 +0100
[CABMAN] Fix 2 handle leaks, in case of error (#2044)
CORE-11090
---
sdk/tools/cabman/cabinet.cxx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sdk/tools/cabman/cabinet.cxx b/sdk/tools/cabman/cabinet.cxx
index 39400498c19..64888daea2b 100644
--- a/sdk/tools/cabman/cabinet.cxx
+++ b/sdk/tools/cabman/cabinet.cxx
@@ -414,6 +414,7 @@ bool CCabinet::SetCabinetReservedFile(char* FileName)
if (CabinetReservedFileSize == (ULONG)-1)
{
DPRINT(MIN_TRACE, ("Cannot read from cabinet reserved file.\n"));
+ fclose(FileHandle);
return false;
}
@@ -1761,6 +1762,7 @@ bool CCabinet::CreateSimpleCabinet()
if(Status != CAB_STATUS_SUCCESS)
{
DPRINT(MIN_TRACE, ("Cannot add file to cabinet (%u).\n",
(UINT)Status));
+ FindClose(hFind);
goto cleanup;
}
}