Module: wine Branch: refs/heads/master Commit: ec5b3c3ea68c2a6b6f95d105562752ba2d203786 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ec5b3c3ea68c2a6b6f95d105...
Author: Robert Shearman rob@codeweavers.com Date: Fri Jun 2 20:43:44 2006 +0100
rpcrt4: Freeing a NULL context handle is allowed.
---
dlls/rpcrt4/ndr_marshall.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index befe124..03f5c6c 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -4504,12 +4504,15 @@ static UINT ndr_update_context_handle(ND /* a null UUID means we should free the context handle */ if (IsEqualGUID(&chi->uuid, &GUID_NULL)) { - che = get_context_entry(*CContext); - if (!che) - return ERROR_INVALID_HANDLE; - list_remove(&che->entry); - HeapFree(GetProcessHeap(), 0, che); - che = NULL; + if (*CContext) + { + che = get_context_entry(*CContext); + if (!che) + return ERROR_INVALID_HANDLE; + list_remove(&che->entry); + HeapFree(GetProcessHeap(), 0, che); + che = NULL; + } } /* if there's no existing entry matching the GUID, allocate one */ else if (!(che = context_entry_from_guid(&chi->uuid)))