s4:libnet - free the "c" context also on error conditions
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 14 Aug 2010 16:47:15 +0000 (18:47 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 14 Aug 2010 16:48:20 +0000 (18:48 +0200)
(and if it's NULL then "talloc_free" does ignore it)

source4/libnet/libnet_group.c
source4/libnet/libnet_user.c

index 7679b426107fa24763d31d22c494d82f00668807..e3d51f342bbfd224490134317eb5f74fefd40c8c 100644 (file)
@@ -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;
        }
 
index 7f93b3f6d55b8d94e9ad6b104f6043cb5075ce24..d0eb5afde8a276b21f0dfdb73a37a69ef4a158b0 100644 (file)
@@ -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) ||