Eric Pouech : winhelp: Avoid accessing a window in global window list after it has been freed.
Alexandre Julliard
julliard at winehq.org
Mon Jun 14 13:01:15 CDT 2010
Module: wine
Branch: master
Commit: 3b07c851f84792689f97fc9036a08d40c4d1d3c2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3b07c851f84792689f97fc9036a08d40c4d1d3c2
Author: Eric Pouech <eric.pouech at orange.fr>
Date: Sat Jun 12 21:55:05 2010 +0200
winhelp: Avoid accessing a window in global window list after it has been freed.
---
programs/winhlp32/macro.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c
index f75b63d..ca0fc8c 100644
--- a/programs/winhlp32/macro.c
+++ b/programs/winhlp32/macro.c
@@ -281,24 +281,32 @@ static void CALLBACK MACRO_CheckItem(LPCSTR str)
static void CALLBACK MACRO_CloseSecondarys(void)
{
WINHELP_WINDOW *win;
+ WINHELP_WINDOW *next;
WINE_TRACE("()\n");
- for (win = Globals.win_list; win; win = win->next)
+ for (win = Globals.win_list; win; win = next)
+ {
+ next = win->next;
if (lstrcmpi(win->info->name, "main"))
WINHELP_ReleaseWindow(win);
+ }
}
static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
{
WINHELP_WINDOW *win;
+ WINHELP_WINDOW *next;
WINE_TRACE("(\"%s\")\n", lpszWindow);
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
- for (win = Globals.win_list; win; win = win->next)
+ for (win = Globals.win_list; win; win = next)
+ {
+ next = win->next;
if (!lstrcmpi(win->info->name, lpszWindow))
WINHELP_ReleaseWindow(win);
+ }
}
static void CALLBACK MACRO_Compare(LPCSTR str)
More information about the wine-cvs
mailing list