summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-06 14:45:24 +0100
committerGünther Deschner <gd@samba.org>2012-12-13 01:01:13 +0100
commit229d934d2fb653e02b38d242bf01f199434cd1f3 (patch)
tree09b8a6104db9fb64c698c281b1adbc6b40c6d90f /source4
parentbdc2f4bd91c3eb0ce0fa87d2d21668e064b106b6 (diff)
downloadsamba-229d934d2fb653e02b38d242bf01f199434cd1f3.tar.gz
samba-229d934d2fb653e02b38d242bf01f199434cd1f3.tar.bz2
samba-229d934d2fb653e02b38d242bf01f199434cd1f3.zip
s4-libnet: Fix setting the group handle and return codes.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Dec 13 01:01:14 CET 2012 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/groupman.c13
1 files changed, 9 insertions, 4 deletions
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);
}