[WIN32K]
authorChristoph von Wittich <christoph_vw@reactos.org>
Fri, 24 Apr 2015 18:38:48 +0000 (18:38 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Fri, 24 Apr 2015 18:38:48 +0000 (18:38 +0000)
fix a memory leak in error case

svn path=/trunk/; revision=67383

reactos/win32ss/gdi/ntgdi/icm.c

index d06dfc2..9a2812b 100644 (file)
@@ -150,8 +150,12 @@ NtGdiGetDeviceGammaRamp(
     }
 
     Ret = IntGetDeviceGammaRamp((HDEV)dc->ppdev, SafeRamp);
-
-    if (!Ret) return Ret;
+    if (!Ret)
+    {
+        DC_UnlockDc(dc);
+        ExFreePoolWithTag(SafeRamp, GDITAG_ICM);
+        return Ret;
+    }
 
     _SEH2_TRY
     {