From 57fc7ee28265422ef5c6485d20db418ded5e5eb1 Mon Sep 17 00:00:00 2001 From: Allan Tong Date: Sun, 14 Oct 2007 04:05:37 -0400 Subject: shell32: Fix a memory leak. --- dlls/shell32/systray.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index 2258eb9..cb67fd8 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -169,7 +169,11 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid) GetBitmapBits(iconinfo.hbmMask, cbMaskBits, buffer); buffer += cbMaskBits; GetBitmapBits(iconinfo.hbmColor, cbColourBits, buffer); - buffer += cbColourBits; + + /* Reset pointer to allocated block so it can be freed later. + * Note that cds.lpData cannot be passed to HeapFree since it + * points to nid when no icon info is found. */ + buffer = cds.lpData; DeleteObject(iconinfo.hbmMask); DeleteObject(iconinfo.hbmColor); -- 1.4.4.2