Sebastian Lackner : comctl32: Allocate new memory in notify_forward_header () to avoid Free() on wrong pointer. (Valgrind).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 23 12:57:40 CDT 2014


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Sun Jun 22 02:30:45 2014 +0200

comctl32: Allocate new memory in notify_forward_header() to avoid Free() on wrong pointer. (Valgrind).

---

 dlls/comctl32/listview.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 7670f18..bc748c6 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -784,6 +784,7 @@ static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, NMHEADERW *lp
         if (lpnmh->pitem->mask & HDI_TEXT)
         {
             text = (LPCWSTR)lpnmh->pitem->pszText;
+            lpnmh->pitem->pszText = NULL;
             Str_SetPtrWtoA(&lpnmh->pitem->pszText, text);
         }
         /* convert filter text */
@@ -791,6 +792,7 @@ static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, NMHEADERW *lp
              lpnmh->pitem->pvFilter)
         {
             filter = (LPCWSTR)((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText;
+            ((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText = NULL;
             Str_SetPtrWtoA(&((HD_TEXTFILTERA*)lpnmh->pitem->pvFilter)->pszText, filter);
         }
     }




More information about the wine-cvs mailing list