Commit ec5b3c3e authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Freeing a NULL context handle is allowed.

parent 1a346a4a
...@@ -4504,6 +4504,8 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext, ...@@ -4504,6 +4504,8 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext,
/* a null UUID means we should free the context handle */ /* a null UUID means we should free the context handle */
if (IsEqualGUID(&chi->uuid, &GUID_NULL)) if (IsEqualGUID(&chi->uuid, &GUID_NULL))
{ {
if (*CContext)
{
che = get_context_entry(*CContext); che = get_context_entry(*CContext);
if (!che) if (!che)
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
...@@ -4511,6 +4513,7 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext, ...@@ -4511,6 +4513,7 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext,
HeapFree(GetProcessHeap(), 0, che); HeapFree(GetProcessHeap(), 0, che);
che = NULL; che = NULL;
} }
}
/* if there's no existing entry matching the GUID, allocate one */ /* if there's no existing entry matching the GUID, allocate one */
else if (!(che = context_entry_from_guid(&chi->uuid))) else if (!(che = context_entry_from_guid(&chi->uuid)))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment