}
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;
}
NULL);
Status = NtOpenKey(&SubKeyHandle,
- DELETE | KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE,
+ DELETE | KEY_ENUMERATE_SUB_KEYS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{