r23402: Got bitten by a talloc hierarchy. Make sure we alloc
authorJeremy Allison <jra@samba.org>
Sat, 9 Jun 2007 00:27:28 +0000 (00:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:13 +0000 (12:23 -0500)
off the pipe ctx now ->names is part of the containing
struct.
Jeremy.
(This used to be commit 02fd43490212e9ff8f784ce4d33d64566d58fd82)

source3/rpc_server/srv_lsa_nt.c

index f9b86d0c6723c3180626c5a6535d5b95fce13ada..0d29df72bf181daaff80d4e6bcbd8c1387155821 100644 (file)
@@ -420,7 +420,7 @@ static NTSTATUS init_reply_lookup_sids(TALLOC_CTX *mem_ctx,
        if (names->num_entries) {
                int i;
 
-               oldnames->name = TALLOC_ARRAY(oldnames, LSA_TRANS_NAME, names->num_entries);
+               oldnames->name = TALLOC_ARRAY(mem_ctx, LSA_TRANS_NAME, names->num_entries);
 
                if (!oldnames->name) {
                        return NT_STATUS_NO_MEMORY;
@@ -838,8 +838,8 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p,
                return status;
        }
 
-       names->name = TALLOC_ARRAY(names, LSA_TRANS_NAME2, num_sids);
-       names->uni_name = TALLOC_ARRAY(names, UNISTR2, num_sids);
+       names->name = TALLOC_ARRAY(p->mem_ctx, LSA_TRANS_NAME2, num_sids);
+       names->uni_name = TALLOC_ARRAY(p->mem_ctx, UNISTR2, num_sids);
        if ((names->name == NULL) || (names->uni_name == NULL)) {
                return NT_STATUS_NO_MEMORY;
        }