s4-winbind: fixed two valgrind errors
authorAndrew Tridgell <tridge@samba.org>
Thu, 16 Sep 2010 11:17:54 +0000 (21:17 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 16 Sep 2010 11:58:58 +0000 (21:58 +1000)
- allocate the dc info on the right structure
- zero the number of group members when allocating the winbindd_gr
  return

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/winbind/wb_cmd_getgrgid.c
source4/winbind/wb_dom_info.c

index 93e01c8cf434892b70a305c974d6360f50078150..fe946ed25795eefc570972cdc10be06906989f82 100644 (file)
@@ -130,7 +130,7 @@ static void cmd_getgrgid_recv_group_info(struct composite_context *ctx)
 
        DEBUG(5, ("cmd_getgrgid_recv_group_info called\n"));
 
-       gr = talloc(state, struct winbindd_gr);
+       gr = talloc_zero(state, struct winbindd_gr);
        if (composite_nomem(gr, state->ctx)) return;
 
        group_info = talloc(state, struct libnet_GroupInfo);
index d2ce8a9f0a8c55a98a256d85d508464302dc1792..c0d708ca91ae2155d61c0b28ee53ec88ec34581b 100644 (file)
@@ -96,7 +96,7 @@ static void get_dom_info_recv_addrs(struct tevent_req *req)
        struct get_dom_info_state *state = tevent_req_callback_data(req, struct get_dom_info_state);
        struct finddcs finddcs_io;
 
-       state->info->dc = talloc(state, struct nbt_dc_name);
+       state->info->dc = talloc(state->info, struct nbt_dc_name);
 
        state->ctx->status = finddcs_cldap_recv(req, state->info, &finddcs_io);
        if (!composite_is_ok(state->ctx)) return;