1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s4:librpc/rpc: fix memory hierachie in dcerpc_epm_map_binding_send()

We should allocate on 's' the internal state, not on the callers
mem_ctx.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-01-25 11:13:26 +01:00 committed by Günther Deschner
parent 4cf691ce1f
commit 4340590ae9

View File

@ -247,11 +247,6 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
s->binding = binding;
s->table = table;
/* anonymous credentials for rpc connection used to get endpoint mapping */
anon_creds = cli_credentials_init(mem_ctx);
if (composite_nomem(anon_creds, c)) return c;
cli_credentials_set_anonymous(anon_creds);
/*
First, check if there is a default endpoint specified in the IDL
*/
@ -291,7 +286,11 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
}
}
epmapper_binding = talloc_zero(c, struct dcerpc_binding);
/* anonymous credentials for rpc connection used to get endpoint mapping */
anon_creds = cli_credentials_init_anon(s);
if (composite_nomem(anon_creds, c)) return c;
epmapper_binding = talloc_zero(s, struct dcerpc_binding);
if (composite_nomem(epmapper_binding, c)) return c;
/* basic endpoint mapping data */
@ -311,7 +310,7 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
epmapper_binding->endpoint = NULL;
/* initiate rpc pipe connection */
pipe_connect_req = dcerpc_pipe_connect_b_send(c, epmapper_binding,
pipe_connect_req = dcerpc_pipe_connect_b_send(s, epmapper_binding,
&ndr_table_epmapper,
anon_creds, c->event_ctx,
lp_ctx);