mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
xcopy: Fix some memory leaks.
This commit is contained in:
parent
f0c31f2e8a
commit
a8df7fddd5
@ -507,6 +507,7 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
|
||||
BOOL copiedFile = FALSE;
|
||||
DWORD destAttribs, srcAttribs;
|
||||
BOOL skipFile;
|
||||
int ret = 0;
|
||||
|
||||
/* Allocate some working memory on heap to minimize footprint */
|
||||
finddata = HeapAlloc(GetProcessHeap(), 0, sizeof(WIN32_FIND_DATA));
|
||||
@ -718,7 +719,8 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
|
||||
if (flags & OPT_IGNOREERRORS) {
|
||||
skipFile = TRUE;
|
||||
} else {
|
||||
return RC_WRITEERROR;
|
||||
ret = RC_WRITEERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -780,12 +782,14 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
/* free up memory */
|
||||
HeapFree(GetProcessHeap(), 0, finddata);
|
||||
HeapFree(GetProcessHeap(), 0, inputpath);
|
||||
HeapFree(GetProcessHeap(), 0, outputpath);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user