Author: mjansen
Date: Sat Feb 18 22:54:31 2017
New Revision: 73832
URL:
http://svn.reactos.org/svn/reactos?rev=73832&view=rev
Log:
[KS] Cleanup in the failure path of KsCreateDefaultClock. Patch by Sebastian Gasiorek. CID
1322124 CORE-12784 #resolve #comment Thanks!
Modified:
trunk/reactos/drivers/ksfilter/ks/clocks.c
Modified: trunk/reactos/drivers/ksfilter/ks/clocks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/clocks…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/clocks.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/clocks.c [iso-8859-1] Sat Feb 18 22:54:31 2017
@@ -395,7 +395,10 @@
/* let's allocate the clock struct */
Clock = AllocateItem(NonPagedPool, sizeof(KSICLOCK));
if (!Clock)
+ {
+ FreeItem(ClockCreate);
return STATUS_INSUFFICIENT_RESOURCES;
+ }
/* now allocate the object header */
Status = KsAllocateObjectHeader((PVOID*)&Clock->ObjectHeader, 0, NULL, Irp,
&DispatchTable);
@@ -404,6 +407,7 @@
if (!NT_SUCCESS(Status))
{
/* failed */
+ FreeItem(ClockCreate);
FreeItem(Clock);
return Status;
}