Index: tools/cabman/cabinet.cxx =================================================================== --- tools/cabman/cabinet.cxx (revision 71111) +++ tools/cabman/cabinet.cxx (working copy) @@ -665,6 +665,7 @@ if (CabinetReservedFileSize == (ULONG)-1) { DPRINT(MIN_TRACE, ("Cannot read from cabinet reserved file.\n")); + CloseFile(FileHandle); return false; } @@ -1266,8 +1267,12 @@ OnDiskChange(CabinetNext, DiskNext); Status = Open(); + if (Status != CAB_STATUS_SUCCESS) + { + FreeMemory(Buffer); return Status; + } /* The first data block of the file will not be found as it is located in the previous file */ @@ -1329,6 +1334,7 @@ { DPRINT(MID_TRACE, ("BytesToWrite (%u) != CFData.UncompSize (%d)\n", (UINT)BytesToWrite, CFData.UncompSize)); + CloseFile(DestFile); return CAB_STATUS_INVALID_CAB; } @@ -2167,6 +2173,7 @@ if(Status != CAB_STATUS_SUCCESS) { DPRINT(MIN_TRACE, ("Cannot add file to cabinet (%u).\n", (UINT)Status)); + FindClose(hFind); goto cleanup; } }