From 229d934d2fb653e02b38d242bf01f199434cd1f3 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Dec 2012 14:45:24 +0100 Subject: s4-libnet: Fix setting the group handle and return codes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner Autobuild-User(master): Günther Deschner Autobuild-Date(master): Thu Dec 13 01:01:14 CET 2012 on sn-devel-104 --- source4/libnet/groupman.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source4/libnet') diff --git a/source4/libnet/groupman.c b/source4/libnet/groupman.c index 97236bd7ad..9771ea5496 100644 --- a/source4/libnet/groupman.c +++ b/source4/libnet/groupman.c @@ -94,10 +94,12 @@ NTSTATUS libnet_rpc_groupadd_recv(struct composite_context *c, TALLOC_CTX *mem_c struct groupadd_state *s; status = composite_wait(c); - if (NT_STATUS_IS_OK(status)) { - s = talloc_get_type(c, struct groupadd_state); + if (NT_STATUS_IS_OK(status) && io) { + s = talloc_get_type(c->private_data, struct groupadd_state); + io->out.group_handle = s->group_handle; } + talloc_free(c); return status; } @@ -115,8 +117,11 @@ static void continue_groupadd_created(struct tevent_req *subreq) if (!composite_is_ok(c)) return; c->status = s->creategroup.out.result; - if (!composite_is_ok(c)) return; - + if (!NT_STATUS_IS_OK(c->status)) { + composite_error(c, c->status); + return; + } + composite_done(c); } -- cgit