Module: wine Branch: master Commit: 50275015f8b11d506d4a38c00651b84bc0feb42f URL: http://source.winehq.org/git/wine.git/?a=commit;h=50275015f8b11d506d4a38c006...
Author: Mikołaj Zalewski mikolaj@zalewski.pl Date: Sun Mar 18 11:51:53 2007 +0100
shell32: Don't free user supplied data in Shell_NotifyIcon if GetIconInfo failed.
We should free the nid and in such a case we were doing it.
---
dlls/shell32/systray.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index 1020b3c..824eeb9 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -89,6 +89,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid) { HWND tray; COPYDATASTRUCT cds; + char *buffer = NULL;
TRACE("dwMessage = %d, nid->cbSize=%d\n", dwMessage, nid->cbSize);
@@ -102,7 +103,6 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid) if (nid->uFlags & NIF_ICON) { ICONINFO iconinfo; - char *buffer; BITMAP bmMask; BITMAP bmColour; LONG cbMaskBits; @@ -156,8 +156,7 @@ noicon:
/* FIXME: if statement only needed because we don't support interprocess * icon handles */ - if (nid->uFlags & NIF_ICON) - HeapFree(GetProcessHeap(), 0, cds.lpData); + HeapFree(GetProcessHeap(), 0, buffer);
return TRUE; }