mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user