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:
Robert Shearman 2006-06-02 20:45:59 +01:00 committed by Alexandre Julliard
parent a4fff73ba3
commit a48433453b
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}