s3:winbind: Fix the talloc hierarchy in wb_queryuser_done
authorVolker Lendecke <vl@samba.org>
Sat, 22 Aug 2009 16:35:52 +0000 (18:35 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 23 Aug 2009 08:19:32 +0000 (10:19 +0200)
We need to return state->userinfo beyond the end of wb_queryuser_recv, so the
unmarshalled strings are children of that, not the state that is lost sooner.

Metze, this scheme works fine as long as we only have a single malloc'ed
entity that is returned. I think we need a different scheme in the future
when we might have more than one independent object to be returned.

source3/winbindd/wb_queryuser.c

index 1af44000fe387f63ef09fb09e66eb09bb87d73db..7a2f1de17bb7405e02d9d4836933181ac3a093c3 100644 (file)
@@ -77,7 +77,7 @@ static void wb_queryuser_done(struct tevent_req *subreq)
                req, struct wb_queryuser_state);
        NTSTATUS status, result;
 
-       status = rpccli_wbint_QueryUser_recv(subreq, state, &result);
+       status = rpccli_wbint_QueryUser_recv(subreq, state->info, &result);
        TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);