[WINMM] fix lolvldrv.c memory leak

Robert Reif reif at earthlink.net
Mon Mar 14 22:12:36 CST 2005


Fix memory leak when there are too many drivers.

Found by smatch.
-------------- next part --------------
Index: dlls/winmm/lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.63
diff -u -p -r1.63 lolvldrv.c
--- dlls/winmm/lolvldrv.c	17 Dec 2004 19:04:28 -0000	1.63
+++ dlls/winmm/lolvldrv.c	15 Mar 2005 04:06:40 -0000
@@ -309,6 +309,7 @@ LPWINE_MLD	MMDRV_Alloc(UINT size, UINT t
     if (i == MAX_MM_MLDRVS) {
 	/* the MM_MLDrvs table could be made growable in the future if needed */
 	ERR("Too many open drivers\n");
+        HeapFree(GetProcessHeap(), 0, mld);
 	return NULL;
     }
     MM_MLDrvs[i] = mld;


More information about the wine-patches mailing list