pdb: Fix CID 1427624 Resource leak
authorVolker Lendecke <vl@samba.org>
Wed, 17 Jan 2018 13:38:41 +0000 (14:38 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 17 Jan 2018 18:24:11 +0000 (19:24 +0100)
It's not exactly a resource leak (we only really realloc if we shrink
dramatically), but assigning the result from tdb_realloc looks nicer.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/passdb/pdb_samba_dsdb.c

index 16a7a85..b06267b 100644 (file)
@@ -2959,7 +2959,7 @@ static NTSTATUS pdb_samba_dsdb_enum_trusteddoms(struct pdb_methods *m,
                domains[di++] = d;
        }
 
-       talloc_realloc(domains, domains, struct trustdom_info *, di);
+       domains = talloc_realloc(domains, domains, struct trustdom_info *, di);
        *_domains = talloc_move(mem_ctx, &domains);
        *_num_domains = di;
        TALLOC_FREE(tmp_ctx);