msi: Don't leak the file handle on error in cabinet_close_file_info().

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2021-09-13 12:05:00 +02:00 committed by Alexandre Julliard
parent c8e2802391
commit a0a800ab1b

View file

@ -507,16 +507,23 @@ static INT_PTR cabinet_close_file_info(FDINOTIFICATIONTYPE fdint,
data->mi->is_continuous = FALSE;
if (!DosDateTimeToFileTime(pfdin->date, pfdin->time, &ft))
{
CloseHandle(handle);
return -1;
}
if (!LocalFileTimeToFileTime(&ft, &ftLocal))
{
CloseHandle(handle);
return -1;
}
if (!SetFileTime(handle, &ftLocal, 0, &ftLocal))
{
CloseHandle(handle);
return -1;
}
CloseHandle(handle);
data->cb(data->package, data->curfile, MSICABEXTRACT_FILEEXTRACTED, NULL, NULL,
data->user);
data->cb(data->package, data->curfile, MSICABEXTRACT_FILEEXTRACTED, NULL, NULL, data->user);
msi_free(data->curfile);
data->curfile = NULL;