From: "Olivier F. R. Dierick" Subject: Shell32: Check null handles before freeing Message-Id: <1448434961.21605.26.camel@piezo3.piezo-forte.be> Date: Wed, 25 Nov 2015 08:02:41 +0100 Fix one of the error leak source that prevents the installer to succeed (bug 36838). The original code did not check if the handles were null before freeing them. For some reason they happen to be null and last error is set to ERROR_INVALID_HANDLE. The game installer chokes at some point when the last error is anything but zero and fails to complete the installation. Checking if the handles are non-null before freeing them avoids this. According to MSDN, it is not an error to have null values for those handles. Signed-off-by: Olivier F. R. Dierick --- dlls/shell32/changenotify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- Olivier F. R. Dierick o.dierick@piezo-forte.be From 42203730bee8ddc101b14f3406d0da6d8561e8e0 Mon Sep 17 00:00:00 2001 From: "Olivier F. R. Dierick" Date: Tue, 11 Aug 2015 01:55:48 +0200 Subject: Check null handles before freeing Signed-off-by: Olivier F. R. Dierick --- dlls/shell32/changenotify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index 2efb297..548fb55 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -409,9 +409,9 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID list_remove(&cur->entry); SHFree(cur); } - SHFreeShared(shared_data, GetCurrentProcessId()); - SHFree(Pidls[0]); - SHFree(Pidls[1]); + if(shared_data) SHFreeShared(shared_data, GetCurrentProcessId()); + if(Pidls[0]) SHFree(Pidls[0]); + if(Pidls[1]) SHFree(Pidls[1]); if (wEventId & SHCNE_ASSOCCHANGED) { -- 1.7.10.4