mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 21:22:24 +00:00
don't free the string allocated by RtlDosPathNameToNtPathName_U using RtlFreeUnicodeString because the string isn't allocated with the USTR tag
svn path=/trunk/; revision=20974
This commit is contained in:
parent
cb96a25169
commit
b0a1eba149
2 changed files with 28 additions and 10 deletions
|
@ -2662,7 +2662,9 @@ RegLoadKeyW (HKEY hKey,
|
|||
Status = NtLoadKey (&KeyObjectAttributes,
|
||||
&FileObjectAttributes);
|
||||
|
||||
RtlFreeUnicodeString (&FileName);
|
||||
RtlFreeHeap (RtlGetProcessHeap (),
|
||||
0,
|
||||
FileName.Buffer);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -3948,7 +3950,9 @@ RegReplaceKeyW (HKEY hKey,
|
|||
NULL,
|
||||
NULL))
|
||||
{
|
||||
RtlFreeUnicodeString (&NewFileName);
|
||||
RtlFreeHeap (RtlGetProcessHeap (),
|
||||
0,
|
||||
NewFileName.Buffer);
|
||||
if (CloseRealKey)
|
||||
{
|
||||
NtClose (RealKeyHandle);
|
||||
|
@ -3967,8 +3971,12 @@ RegReplaceKeyW (HKEY hKey,
|
|||
RealKeyHandle,
|
||||
&OldObjectAttributes);
|
||||
|
||||
RtlFreeUnicodeString (&OldFileName);
|
||||
RtlFreeUnicodeString (&NewFileName);
|
||||
RtlFreeHeap (RtlGetProcessHeap (),
|
||||
0,
|
||||
OldFileName.Buffer);
|
||||
RtlFreeHeap (RtlGetProcessHeap (),
|
||||
0,
|
||||
NewFileName.Buffer);
|
||||
|
||||
if (CloseRealKey)
|
||||
{
|
||||
|
@ -4063,7 +4071,9 @@ RegRestoreKeyW (HKEY hKey,
|
|||
&IoStatusBlock,
|
||||
FILE_SHARE_READ,
|
||||
FILE_SYNCHRONOUS_IO_NONALERT);
|
||||
RtlFreeUnicodeString (&FileName);
|
||||
RtlFreeHeap (RtlGetProcessHeap(),
|
||||
0,
|
||||
FileName.Buffer);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -4165,7 +4175,9 @@ RegSaveKeyW (HKEY hKey,
|
|||
FILE_OPEN_FOR_BACKUP_INTENT | FILE_SYNCHRONOUS_IO_NONALERT,
|
||||
NULL,
|
||||
0);
|
||||
RtlFreeUnicodeString (&FileName);
|
||||
RtlFreeHeap (RtlGetProcessHeap (),
|
||||
0,
|
||||
FileName.Buffer);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
|
|
@ -243,6 +243,11 @@ GetFileSecurityW(LPCWSTR lpFileName,
|
|||
&StatusBlock,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
0);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
FileName.Buffer);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("NtOpenFile() failed (Status %lx)\n", Status);
|
||||
|
@ -250,8 +255,6 @@ GetFileSecurityW(LPCWSTR lpFileName,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
RtlFreeUnicodeString(&FileName);
|
||||
|
||||
Status = NtQuerySecurityObject(FileHandle,
|
||||
RequestedInformation,
|
||||
pSecurityDescriptor,
|
||||
|
@ -387,6 +390,11 @@ SetFileSecurityW (LPCWSTR lpFileName,
|
|||
&StatusBlock,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
0);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
FileName.Buffer);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("NtOpenFile() failed (Status %lx)\n", Status);
|
||||
|
@ -394,8 +402,6 @@ SetFileSecurityW (LPCWSTR lpFileName,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
RtlFreeUnicodeString(&FileName);
|
||||
|
||||
Status = NtSetSecurityObject(FileHandle,
|
||||
SecurityInformation,
|
||||
pSecurityDescriptor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue