Commit a71a22c5 authored by Alexandre Julliard's avatar Alexandre Julliard

cabinet: Fixed fd leak in case of error.

parent 7ecc283b
...@@ -2446,7 +2446,7 @@ BOOL __cdecl FDICopy( ...@@ -2446,7 +2446,7 @@ BOOL __cdecl FDICopy(
{ {
FDICABINETINFO fdici; FDICABINETINFO fdici;
FDINOTIFICATION fdin; FDINOTIFICATION fdin;
int cabhf, filehf, idx; int cabhf, filehf = 0, idx;
unsigned int i; unsigned int i;
char fullpath[MAX_PATH]; char fullpath[MAX_PATH];
size_t pathlen, filenamelen; size_t pathlen, filenamelen;
...@@ -2826,6 +2826,7 @@ BOOL __cdecl FDICopy( ...@@ -2826,6 +2826,7 @@ BOOL __cdecl FDICopy(
fdin.time = file->time; fdin.time = file->time;
fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */ fdin.attribs = file->attribs; /* FIXME: filter _A_EXEC? */
((*pfnfdin)(fdintCLOSE_FILE_INFO, &fdin)); ((*pfnfdin)(fdintCLOSE_FILE_INFO, &fdin));
filehf = 0;
switch (err) { switch (err) {
case DECR_OK: case DECR_OK:
...@@ -2914,6 +2915,8 @@ BOOL __cdecl FDICopy( ...@@ -2914,6 +2915,8 @@ BOOL __cdecl FDICopy(
break; break;
} }
if (filehf) PFDI_CLOSE(hfdi, filehf);
while (decomp_state) { while (decomp_state) {
fdi_decomp_state *prev_fds; fdi_decomp_state *prev_fds;
......
...@@ -1111,10 +1111,10 @@ static void test_uiLevelFlags(void) ...@@ -1111,10 +1111,10 @@ static void test_uiLevelFlags(void)
todo_wine todo_wine
{ {
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n"); ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
} }
delete_pf("msitest", FALSE); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
delete_cab_files(); delete_cab_files();
DeleteFile(msifile); DeleteFile(msifile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment