winex11: Fix remaining memory leak (coverity) (try 2)

André Hentschel nerv at dawncrow.de
Mon Nov 26 10:15:25 CST 2012


CID 731826
---
 dlls/winex11.drv/clipboard.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index e2f5b12..e2a7cd7 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -1328,7 +1328,12 @@ static HANDLE X11DRV_CLIPBOARD_ImportXAPIXMAP(Display *display, Window w, Atom p
         /* Get the Pixmap dimensions and bit depth */
         if (!XGetGeometry(gdi_display, *pPixmap, &root, &x, &y, &width, &height,
                           &border_width, &depth)) depth = 0;
-        if (!pixmap_formats[depth]) return 0;
+
+        if (!pixmap_formats[depth])
+        {
+            HeapFree(GetProcessHeap(), 0, pPixmap);
+            return 0;
+        }
 
         TRACE("\tPixmap properties: width=%d, height=%d, depth=%d\n",
               width, height, depth);
-- 
1.8.0


-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list