From ab3e20b82fca206d03a68acc501fdbd5a59b47a7 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 14 Aug 2010 18:47:15 +0200 Subject: s4:libnet - free the "c" context also on error conditions (and if it's NULL then "talloc_free" does ignore it) --- source4/libnet/libnet_group.c | 1 + source4/libnet/libnet_user.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/libnet/libnet_group.c b/source4/libnet/libnet_group.c index 7679b42610..e3d51f342b 100644 --- a/source4/libnet/libnet_group.c +++ b/source4/libnet/libnet_group.c @@ -704,6 +704,7 @@ NTSTATUS libnet_GroupList_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, struct grouplist_state *s; if (c == NULL || mem_ctx == NULL || io == NULL) { + talloc_free(c); return NT_STATUS_INVALID_PARAMETER; } diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c index 7f93b3f6d5..d0eb5afde8 100644 --- a/source4/libnet/libnet_user.c +++ b/source4/libnet/libnet_user.c @@ -1171,9 +1171,10 @@ NTSTATUS libnet_UserList_recv(struct composite_context* c, TALLOC_CTX *mem_ctx, struct userlist_state *s; if (c == NULL || mem_ctx == NULL || r == NULL) { + talloc_free(c); return NT_STATUS_INVALID_PARAMETER; } - + status = composite_wait(c); if (NT_STATUS_IS_OK(status) || NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES) || -- cgit