From aceb12265fd4043882ec010cd82def79feced9f7 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Tue, 17 Jun 2008 21:21:55 +0100 Subject: [PATCH] user32: Dangling pointer fix. --- dlls/user32/dde_misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/user32/dde_misc.c b/dlls/user32/dde_misc.c index 9061836be19..049deaee685 100644 --- a/dlls/user32/dde_misc.c +++ b/dlls/user32/dde_misc.c @@ -515,7 +515,6 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, ret = DMLERR_INVALIDPARAMETER; goto theError; } - HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ /* can't reinitialise if we have initialised nothing !! */ reference_inst = WDML_InstanceList; /* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */ @@ -571,6 +570,9 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, reference_inst->CBFflags = pInstance->CBFflags; reference_inst->clientOnly = pInstance->clientOnly; reference_inst->monitorFlags = pInstance->monitorFlags; + + HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ + LeaveCriticalSection(&WDML_CritSect); }