From b0bba4003e928cdf0540047d6e4b7659cb0ac765 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 4 Jul 2010 20:04:28 +0200 Subject: s4:libnet - add missing "talloc_free"s for "c" contexts on "recv" operations --- source4/libnet/libnet_group.c | 3 ++- source4/libnet/libnet_lookup.c | 4 +--- source4/libnet/libnet_user.c | 6 +++++- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/libnet/libnet_group.c b/source4/libnet/libnet_group.c index f098667555..8c88aa38bb 100644 --- a/source4/libnet/libnet_group.c +++ b/source4/libnet/libnet_group.c @@ -147,6 +147,7 @@ NTSTATUS libnet_CreateGroup_recv(struct composite_context *c, r->out.error_string = talloc_strdup(mem_ctx, nt_errstr(status)); } + talloc_free(c); return status; } @@ -408,7 +409,6 @@ NTSTATUS libnet_GroupInfo_recv(struct composite_context* c, TALLOC_CTX *mem_ctx, } talloc_free(c); - return status; } @@ -731,6 +731,7 @@ NTSTATUS libnet_GroupList_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, io->out.error_string = talloc_asprintf(mem_ctx, "Error: %s", nt_errstr(status)); } + talloc_free(c); return status; } diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index 21851d5ae8..177292c7cd 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -217,9 +217,7 @@ NTSTATUS libnet_LookupDCs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, { NTSTATUS status; status = finddcs_recv(c, mem_ctx, &io->out.num_dcs, &io->out.dcs); - if (!NT_STATUS_IS_OK(status)) { - return status; - } + /* "c" already freed here */ return status; } diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c index f05d2bd566..0055639974 100644 --- a/source4/libnet/libnet_user.c +++ b/source4/libnet/libnet_user.c @@ -178,6 +178,7 @@ NTSTATUS libnet_CreateUser_recv(struct composite_context *c, TALLOC_CTX *mem_ctx r->out.error_string = talloc_strdup(mem_ctx, nt_errstr(status)); } + talloc_free(c); return status; } @@ -346,6 +347,7 @@ NTSTATUS libnet_DeleteUser_recv(struct composite_context *c, TALLOC_CTX *mem_ctx r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string); } + talloc_free(c); return status; } @@ -572,6 +574,8 @@ NTSTATUS libnet_ModifyUser_recv(struct composite_context *c, TALLOC_CTX *mem_ctx struct libnet_ModifyUser *r) { NTSTATUS status = composite_wait(c); + + talloc_free(c); return status; } @@ -868,7 +872,6 @@ NTSTATUS libnet_UserInfo_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, } talloc_free(c); - return status; } @@ -1195,6 +1198,7 @@ NTSTATUS libnet_UserList_recv(struct composite_context* c, TALLOC_CTX *mem_ctx, r->out.error_string = talloc_asprintf(mem_ctx, "Error: %s", nt_errstr(status)); } + talloc_free(c); return status; } -- cgit