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

rpcrt4: The lifetime of the binding handle stored in the context

handle is independent of the binding handle used in the call that unmarshaled it, so we should use RpcBindingCopy to make a copy of it and then call RpcBindingFree later to free it.
parent a4fff73b
......@@ -4516,6 +4516,7 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext,
if (!che)
return ERROR_INVALID_HANDLE;
list_remove(&che->entry);
RpcBindingFree(&che->handle);
HeapFree(GetProcessHeap(), 0, che);
che = NULL;
}
......@@ -4527,7 +4528,7 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext,
if (!che)
return ERROR_NOT_ENOUGH_MEMORY;
che->magic = NDR_CONTEXT_HANDLE_MAGIC;
che->handle = hBinding;
RpcBindingCopy(hBinding, &che->handle);
list_add_tail(&context_handle_list, &che->entry);
memcpy(&che->wire_data, chi, sizeof *chi);
}
......
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