mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[KERNEL32] ReplaceFileW:
- Initialize Unicode string structure, so that only allocated buffers are freed when leaving the function - Fixes several heap warnings in kernel32:file test svn path=/trunk/; revision=47407
This commit is contained in:
parent
24dd4301ad
commit
c8e90e9d05
1 changed files with 6 additions and 3 deletions
|
@ -1906,7 +1906,8 @@ ReplaceFileW(
|
|||
)
|
||||
{
|
||||
HANDLE hReplaced = NULL, hReplacement = NULL;
|
||||
UNICODE_STRING NtReplacedName, NtReplacementName;
|
||||
UNICODE_STRING NtReplacedName = { 0, 0, NULL };
|
||||
UNICODE_STRING NtReplacementName = { 0, 0, NULL };
|
||||
DWORD Error = ERROR_SUCCESS;
|
||||
NTSTATUS Status;
|
||||
BOOL Ret = FALSE;
|
||||
|
@ -2029,8 +2030,10 @@ Cleanup:
|
|||
if (hReplacement) NtClose(hReplacement);
|
||||
if (Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||
|
||||
RtlFreeUnicodeString(&NtReplacementName);
|
||||
RtlFreeUnicodeString(&NtReplacedName);
|
||||
if (NtReplacementName.Buffer)
|
||||
RtlFreeHeap(GetProcessHeap(), 0, NtReplacementName.Buffer);
|
||||
if (NtReplacedName.Buffer)
|
||||
RtlFreeHeap(GetProcessHeap(), 0, NtReplacedName.Buffer);
|
||||
|
||||
/* If there was an error, set the error code */
|
||||
if(!Ret)
|
||||
|
|
Loading…
Reference in a new issue