Module: wine Branch: master Commit: 574cf27f2afd676fb90087be1c0bd6967c1ca160 URL: http://source.winehq.org/git/wine.git/?a=commit;h=574cf27f2afd676fb90087be1c...
Author: André Hentschel nerv@dawncrow.de Date: Sat Nov 3 17:25:45 2012 +0100
winex11: Avoid memory leaks (coverity).
---
dlls/winex11.drv/clipboard.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index bd3ef7b..e2f5b12 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -1370,6 +1370,8 @@ static HANDLE X11DRV_CLIPBOARD_ImportXAPIXMAP(Display *display, Window w, Atom p } if (bits.free) bits.free( &bits ); } + + HeapFree(GetProcessHeap(), 0, lpdata); }
return hClipData; @@ -1489,7 +1491,10 @@ static HANDLE X11DRV_CLIPBOARD_ImportClipboardData(Display *display, Window w, A /* Turn on the DDESHARE flag to enable shared 32 bit memory */ hClipData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, cbytes); if (hClipData == 0) + { + HeapFree(GetProcessHeap(), 0, lpdata); return NULL; + }
if ((lpClipData = GlobalLock(hClipData))) {