[SERVICES]

Leave the critical section when the allocation of the control packet fails.

Bug spotted by hzlilx.

svn path=/trunk/; revision=50994
This commit is contained in:
Eric Kohl 2011-03-07 20:25:28 +00:00
parent f7049d7fb7
commit 69b1f9091e

View file

@ -700,7 +700,10 @@ ScmControlService(PSERVICE Service,
HEAP_ZERO_MEMORY,
sizeof(SCM_CONTROL_PACKET) + (TotalLength * sizeof(WCHAR)));
if (ControlPacket == NULL)
{
LeaveCriticalSection(&ControlServiceCriticalSection);
return ERROR_NOT_ENOUGH_MEMORY;
}
ControlPacket->dwControl = dwControl;
ControlPacket->dwSize = TotalLength;