Ken Thomases : winemac: Fix a memory leak if posting WM_DROPFILES fails.

Alexandre Julliard julliard at winehq.org
Thu May 15 15:14:28 CDT 2014


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

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed May 14 20:15:30 2014 -0500

winemac: Fix a memory leak if posting WM_DROPFILES fails.

---

 dlls/winemac.drv/dragdrop.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winemac.drv/dragdrop.c b/dlls/winemac.drv/dragdrop.c
index 612a868..ad0bc8c 100644
--- a/dlls/winemac.drv/dragdrop.c
+++ b/dlls/winemac.drv/dragdrop.c
@@ -466,8 +466,8 @@ BOOL query_drag_drop(macdrv_query* query)
                 ret = PostMessageW(hwnd, WM_DROPFILES, (WPARAM)hdrop, 0L);
                 /* hdrop is owned by the message and freed when the recipient calls DragFinish(). */
             }
-            else
-                GlobalFree(hdrop);
+
+            if (!ret) GlobalFree(hdrop);
         }
     }
 




More information about the wine-cvs mailing list