s4:libnet: use dcerpc_binding_dup() in continue_epm_map_binding_send()
authorStefan Metzmacher <metze@samba.org>
Thu, 6 Feb 2014 17:52:20 +0000 (18:52 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 11 Feb 2014 15:20:32 +0000 (16:20 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/libnet/libnet_rpc.c

index c6e241093eb47ef3952a1931c816c0c94a357467..3962d602812e7e8644ef18e8113658d8dc67db9c 100644 (file)
@@ -788,13 +788,9 @@ static void continue_epm_map_binding_send(struct composite_context *c)
        s = talloc_get_type(c->private_data, struct rpc_connect_dci_state);
 
        /* prepare to get endpoint mapping for the requested interface */
-       s->final_binding = talloc_zero(s, struct dcerpc_binding);
+       s->final_binding = dcerpc_binding_dup(s, s->lsa_pipe->binding);
        if (composite_nomem(s->final_binding, c)) return;
        
-       *s->final_binding = *s->lsa_pipe->binding;
-       /* Ensure we keep hold of the member elements */
-       if (composite_nomem(talloc_reference(s->final_binding, s->lsa_pipe->binding), c)) return;
-
        epm_map_req = dcerpc_epm_map_binding_send(c, s->final_binding, s->r.in.dcerpc_iface,
                                                  s->ctx->event_ctx, s->ctx->lp_ctx);
        if (composite_nomem(epm_map_req, c)) return;