[KS] Cleanup in the failure path of KsCreateDefaultClock. Patch by Sebastian Gasiorek. CID 1322124 CORE-12784 #resolve #comment Thanks!

svn path=/trunk/; revision=73832
This commit is contained in:
Mark Jansen 2017-02-18 22:54:31 +00:00
parent 590c4dcc8c
commit 099a790594

View file

@ -395,7 +395,10 @@ KsCreateDefaultClock(
/* let's allocate the clock struct */ /* let's allocate the clock struct */
Clock = AllocateItem(NonPagedPool, sizeof(KSICLOCK)); Clock = AllocateItem(NonPagedPool, sizeof(KSICLOCK));
if (!Clock) if (!Clock)
{
FreeItem(ClockCreate);
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
}
/* now allocate the object header */ /* now allocate the object header */
Status = KsAllocateObjectHeader((PVOID*)&Clock->ObjectHeader, 0, NULL, Irp, &DispatchTable); Status = KsAllocateObjectHeader((PVOID*)&Clock->ObjectHeader, 0, NULL, Irp, &DispatchTable);
@ -404,6 +407,7 @@ KsCreateDefaultClock(
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
/* failed */ /* failed */
FreeItem(ClockCreate);
FreeItem(Clock); FreeItem(Clock);
return Status; return Status;
} }