s4:libnet_UserList: allocate children strings on the correct talloc parent
authorStefan Metzmacher <metze@samba.org>
Sat, 10 Jul 2010 07:04:43 +0000 (09:04 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 10 Jul 2010 07:35:01 +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_user.c

index 0055639974ee4a4c12ec39fea40912f6a911e8e1..7f93b3f6d55b8d94e9ad6b104f6043cb5075ce24 100644 (file)
@@ -1138,11 +1138,11 @@ static void continue_users_enumerated(struct tevent_req *subreq)
                        if (composite_nomem(user_sid, c)) return;
                        
                        /* username */
-                       s->users[i].username = talloc_strdup(c, entry->name.string);
+                       s->users[i].username = talloc_strdup(s->users, entry->name.string);
                        if (composite_nomem(s->users[i].username, c)) return;
 
                        /* sid string */
-                       s->users[i].sid = dom_sid_string(c, user_sid);
+                       s->users[i].sid = dom_sid_string(s->users, user_sid);
                        if (composite_nomem(s->users[i].sid, c)) return;
                }