mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
don't leak memory in RegDeleteTree() when NtEnumerateKey() returns an unexpected error code (such as when there's insufficient system resources to perform the query)
svn path=/trunk/; revision=18255
This commit is contained in:
parent
f710105b8b
commit
e908a4d408
1 changed files with 9 additions and 5 deletions
|
@ -1479,14 +1479,18 @@ ReadFirstSubKey:
|
|||
}
|
||||
|
||||
SubKeyFailure:
|
||||
ASSERT(newDelKeys != NULL);
|
||||
RtlFreeHeap(ProcessHeap,
|
||||
0,
|
||||
newDelKeys);
|
||||
/* newDelKeys can be NULL here when NtEnumerateKey returned an
|
||||
error other than STATUS_BUFFER_TOO_SMALL or STATUS_BUFFER_OVERFLOW! */
|
||||
if (newDelKeys != NULL)
|
||||
{
|
||||
RtlFreeHeap(ProcessHeap,
|
||||
0,
|
||||
newDelKeys);
|
||||
}
|
||||
|
||||
SubKeyFailureNoFree:
|
||||
/* don't break, let's try to delete as many keys as possible */
|
||||
if (Status2 != STATUS_NO_MORE_ENTRIES && NT_SUCCESS(Status))
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = Status2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue