mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
fixed a memory leak in RegDeleteTree() that could be caused when two threads attempt to delete the same tree simultaneously
svn path=/trunk/; revision=18254
This commit is contained in:
parent
64e0a3529d
commit
f710105b8b
1 changed files with 10 additions and 2 deletions
|
@ -1466,7 +1466,15 @@ ReadFirstSubKey:
|
|||
}
|
||||
else if (Status2 == STATUS_NO_MORE_ENTRIES)
|
||||
{
|
||||
ASSERT(newDelKeys == NULL);
|
||||
/* in some race conditions where another thread would delete
|
||||
the same tree at the same time, newDelKeys could actually
|
||||
be != NULL! */
|
||||
if (newDelKeys != NULL)
|
||||
{
|
||||
RtlFreeHeap(ProcessHeap,
|
||||
0,
|
||||
newDelKeys);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1555,7 +1563,7 @@ RegDeleteTreeW(IN HKEY hKey,
|
|||
NULL);
|
||||
|
||||
Status = NtOpenKey(&SubKeyHandle,
|
||||
DELETE | KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE,
|
||||
DELETE | KEY_ENUMERATE_SUB_KEYS,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue