Author: weiden
Date: Fri Sep 1 22:41:00 2006
New Revision: 23870
URL:
http://svn.reactos.org/svn/reactos?rev=23870&view=rev
Log:
Don't leak a reference in NtReleaseSemaphore() in case KeReleaseSemaphore() raises and
exception
Modified:
trunk/reactos/ntoskrnl/ex/sem.c
Modified: trunk/reactos/ntoskrnl/ex/sem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sem.c?rev=2387…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sem.c (original)
+++ trunk/reactos/ntoskrnl/ex/sem.c Fri Sep 1 22:41:00 2006
@@ -342,7 +342,6 @@
IO_NO_INCREMENT,
ReleaseCount,
FALSE);
- ObDereferenceObject(Semaphore);
/* Return the old count if requested */
if(PreviousCount) *PreviousCount = PrevCount;
@@ -352,6 +351,8 @@
Status = _SEH_GetExceptionCode();
}
_SEH_END;
+
+ ObDereferenceObject(Semaphore);
}
/* Return Status */