Author: janderwald
Date: Wed Jun 9 14:16:05 2010
New Revision: 47713
URL:
http://svn.reactos.org/svn/reactos?rev=47713&view=rev
Log:
[KS]
- Fix memory leak
Modified:
trunk/reactos/drivers/ksfilter/ks/topology.c
Modified: trunk/reactos/drivers/ksfilter/ks/topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/topolo…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/topology.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/topology.c [iso-8859-1] Wed Jun 9 14:16:05 2010
@@ -205,24 +205,27 @@
{
Irp->IoStatus.Information = 0;
Status = STATUS_INSUFFICIENT_RESOURCES;
+ RtlFreeUnicodeString(&GuidString);
break;
}
RtlAppendUnicodeStringToString(&KeyName, &LocalMachine);
RtlAppendUnicodeStringToString(&KeyName, &GuidString);
+ RtlFreeUnicodeString(&GuidString);
InitializeObjectAttributes(&ObjectAttributes, &KeyName,
OBJ_CASE_INSENSITIVE, NULL, NULL);
Status = ZwOpenKey(&hKey, GENERIC_READ, &ObjectAttributes);
+ ExFreePool(KeyName.Buffer);
+
if (!NT_SUCCESS(Status))
{
DPRINT1("ZwOpenKey() failed with status 0x%08lx\n", Status);
- ExFreePool(KeyName.Buffer);
- Irp->IoStatus.Information = 0;
- break;
- }
- ExFreePool(KeyName.Buffer);
+ Irp->IoStatus.Information = 0;
+ break;
+ }
+
Status = ZwQueryValueKey(hKey, &Name, KeyValuePartialInformation, NULL,
0, &Size);
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL)
{
@@ -231,6 +234,7 @@
break;
}
+ ASSERT(Size);
KeyInfo = (PKEY_VALUE_PARTIAL_INFORMATION) ExAllocatePool(NonPagedPool,
Size);
if (!KeyInfo)
{