{
DPRINT(MIN_TRACE, ("SetFilePointer() failed, error code is %u.\n", (UINT)GetLastError()));
CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
#else
{
DPRINT(MIN_TRACE, ("fseek() failed.\n"));
CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_FAILURE;
}
Offset = ftell(FileHandle);
if (CFData.UncompSize == 0)
{
if (strlen(DiskNext) == 0)
+ {
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_NOFILE;
+ }
/* CloseCabinet() will destroy all file entries so in case
FileName refers to the FileName field of a CFFOLDER_NODE
Status = Open();
if (Status != CAB_STATUS_SUCCESS)
+ {
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return Status;
+ }
/* The first data block of the file will not be
found as it is located in the previous file */
if (Status == CAB_STATUS_NOFILE)
{
DPRINT(MID_TRACE, ("Cannot locate file (%u).\n", (UINT)Status));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return Status;
}
FILE_BEGIN) == INVALID_SET_FILE_POINTER )
{
DPRINT(MIN_TRACE, ("SetFilePointer() failed, error code is %u.\n", (UINT)GetLastError()));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
#else
if (fseek(FileHandle, (off_t)File->DataBlock->AbsoluteOffset, SEEK_SET) != 0)
{
DPRINT(MIN_TRACE, ("fseek() failed.\n"));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
#endif
{
DPRINT(MID_TRACE, ("BytesToWrite (%u) != CFData.UncompSize (%d)\n",
(UINT)BytesToWrite, CFData.UncompSize));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
FILE_BEGIN) == INVALID_SET_FILE_POINTER )
{
DPRINT(MIN_TRACE, ("SetFilePointer() failed, error code is %u.\n", (UINT)GetLastError()));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
#else
CurrentDataNode->Data.CompSize, SEEK_SET) != 0)
{
DPRINT(MIN_TRACE, ("fseek() failed.\n"));
+ CloseFile(DestFile);
+ FreeMemory(Buffer);
return CAB_STATUS_INVALID_CAB;
}
#endif
if (FileNode->File.FileSize == (ULONG)-1)
{
DPRINT(MIN_TRACE, ("Cannot read from file.\n"));
- FreeMemory(NewFileName);
CloseFile(SrcFile);
return CAB_STATUS_CANNOT_READ;
}
if (GetFileTimes(SrcFile, FileNode) != CAB_STATUS_SUCCESS)
{
DPRINT(MIN_TRACE, ("Cannot read file times.\n"));
- FreeMemory(NewFileName);
CloseFile(SrcFile);
return CAB_STATUS_CANNOT_READ;
}
if (GetAttributesOnFile(FileNode) != CAB_STATUS_SUCCESS)
{
DPRINT(MIN_TRACE, ("Cannot read file attributes.\n"));
- FreeMemory(NewFileName);
CloseFile(SrcFile);
return CAB_STATUS_CANNOT_READ;
}