[ros-diffs] [ekohl] 50994: [SERVICES] Leave the critical section when the allocation of the control packet fails. Bug spotted by hzlilx.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Mon Mar 7 20:25:29 UTC 2011


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/database.c?rev=50994&r1=50993&r2=50994&view=diff
==============================================================================
--- 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;




More information about the Ros-diffs mailing list