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.
This commit is contained in:
parent
a4fff73ba3
commit
a48433453b
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue