s4:libnet_GroupList: allocate children strings on the correct talloc parent
authorStefan Metzmacher <metze@samba.org>
Sat, 10 Jul 2010 07:06:44 +0000 (09:06 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 10 Jul 2010 07:35:02 +0000 (09:35 +0200)
Otherwise the _recv() function won't move the children strings to the
callers memory context and let the callers crash.

metze

source4/libnet/libnet_group.c

index 8c88aa38bb351f79245eaed54a5a5b3a303a6e36..7679b426107fa24763d31d22c494d82f00668807 100644 (file)
@@ -671,11 +671,11 @@ static void continue_groups_enumerated(struct tevent_req *subreq)
                        if (composite_nomem(group_sid, c)) return;
 
                        /* groupname */
-                       s->groups[i].groupname = talloc_strdup(c, entry->name.string);
+                       s->groups[i].groupname = talloc_strdup(s->groups, entry->name.string);
                        if (composite_nomem(s->groups[i].groupname, c)) return;
 
                        /* sid string */
-                       s->groups[i].sid = dom_sid_string(c, group_sid);
+                       s->groups[i].sid = dom_sid_string(s->groups, group_sid);
                        if (composite_nomem(s->groups[i].sid, c)) return;
                }