Piotr Caban : regedit: Fix double free error in GetValueName.

Alexandre Julliard julliard at winehq.org
Thu Oct 31 17:39:29 CDT 2019


Module: wine
Branch: master
Commit: f11a740266cf5504693c8cd32e000d1a3ab77098
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f11a740266cf5504693c8cd32e000d1a3ab77098

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Oct 31 11:22:07 2019 +0100

regedit: Fix double free error in GetValueName.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regedit/listview.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index cdcaa8e067..0132cfb8db 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -38,7 +38,6 @@ DWORD   g_columnToSort = ~0U;
 BOOL    g_invertSort = FALSE;
 WCHAR  *g_currentPath;
 HKEY    g_currentRootKey;
-static  WCHAR *g_valueName;
 static  WCHAR g_szValueNotSet[64];
 
 #define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
@@ -66,16 +65,10 @@ WCHAR *GetValueName(HWND hwndLV)
 {
     INT item;
 
-    if (g_valueName != LPSTR_TEXTCALLBACKW)
-        heap_free(g_valueName);
-    g_valueName = NULL;
-
     item = SendMessageW(hwndLV, LVM_GETNEXTITEM, -1, MAKELPARAM(LVNI_FOCUSED, 0));
     if (item == -1) return NULL;
 
-    g_valueName = GetItemText(hwndLV, item);
-
-    return g_valueName;
+    return GetItemText(hwndLV, item);
 }
 
 BOOL update_listview_path(const WCHAR *path)




More information about the wine-cvs mailing list