[PATCH] ole32: LeaveCriticalSection in one exit case (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jun 22 05:23:49 CDT 2013


When the spy is being freed we would not release the critical
section out of this function.

 502283 Missing unlock

Ciao, Marcus
---
 dlls/ole32/ifs.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c
index 8ec6bd8..5134474 100644
--- a/dlls/ole32/ifs.c
+++ b/dlls/ole32/ifs.c
@@ -217,6 +217,8 @@ static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) {
 	        IMallocSpy_Release(Malloc32.pSpy);
 		Malloc32.SpyReleasePending = FALSE;
 		Malloc32.pSpy = NULL;
+		/* cb == 0 case will release it some lines below. */
+		if (cb) LeaveCriticalSection(&IMalloc32_SpyCS);
 	    }
 
 	    if (0==cb) {
-- 
1.7.10.4




More information about the wine-patches mailing list