=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: winex11: Avoid memory leaks ( coverity).

Alexandre Julliard julliard at winehq.org
Wed Oct 31 17:17:21 CDT 2012


Module: wine
Branch: master
Commit: 585a66a46320dc8bba7771ec147ef3d7a800310e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=585a66a46320dc8bba7771ec147ef3d7a800310e

Author: André Hentschel <nerv at dawncrow.de>
Date:   Tue Oct 30 20:07:22 2012 +0100

winex11: Avoid memory leaks (coverity).

---

 dlls/winex11.drv/clipboard.c |    1 +
 dlls/winex11.drv/xrender.c   |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index 37a115e..bd3ef7b 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -2400,6 +2400,7 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
             if (!tmp)
             {
                 HeapFree(GetProcessHeap(), 0, buf);
+                HeapFree(GetProcessHeap(), 0, prop_data);
                 return FALSE;
             }
 
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index d7f0508..389f684 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -1405,9 +1405,9 @@ static void UploadGlyph(struct xrender_physdev *physDev, int glyph, AA_Type form
 
 	pXRenderAddGlyphs(gdi_display, formatEntry->glyphset, &gid, &gi, 1,
                           buflen ? buf : zero, buflen ? buflen : sizeof(zero));
-	HeapFree(GetProcessHeap(), 0, buf);
     }
 
+    HeapFree(GetProcessHeap(), 0, buf);
     formatEntry->gis[glyph] = gi;
 }
 




More information about the wine-cvs mailing list