Author: ekohl
Date: Mon Mar 7 20:25:28 2011
New Revision: 50994
URL:
http://svn.reactos.org/svn/reactos?rev=50994&view=rev
Log:
[SERVICES]
Leave the critical section when the allocation of the control packet fails.
Bug spotted by hzlilx.
Modified:
trunk/reactos/base/system/services/database.c
Modified: trunk/reactos/base/system/services/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Mon Mar 7 20:25:28 2011
@@ -700,7 +700,10 @@
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;