Fix memory leak in NtUserMonitorFromRect when it return in one case.
authorMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:13:14 +0000 (13:13 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:13:14 +0000 (13:13 +0000)
svn path=/trunk/; revision=20420

reactos/subsys/win32k/ntuser/monitor.c

index cd1f86b..0ff5da7 100644 (file)
@@ -778,7 +778,7 @@ NtUserMonitorFromRect(
    HMONITOR hMonitor = NULL;
    RECT rect;
    NTSTATUS status;
-
+   
    /* get rect */
    status = MmCopyFromCaller(&rect, pRect, sizeof (RECT));
    if (!NT_SUCCESS(status))
@@ -838,6 +838,8 @@ NtUserMonitorFromRect(
                                         numMonitors, 0);
    if (numMonitors <= 0)
    {
+      ExFreePool(hMonitorList);
+      ExFreePool(rectList);
       return (HMONITOR)NULL;
    }