From: Volker Lendecke Date: Wed, 17 Jan 2018 13:38:41 +0000 (+0100) Subject: pdb: Fix CID 1427620 Resource leak X-Git-Tag: samba-4.8.0rc3~40 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=d800e1cd81e575ecc61c5a14b127e8156a098257;p=vlendec%2Fsamba-autobuild%2F.git pdb: Fix CID 1427620 Resource leak It's not exactly a resource leak (we only really realloc if we shrink dramatically), but assigning the result from tdb_realloc looks nicer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13263 Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme (cherry picked from commit 4e5c9427085f001941adaf761b18740a2e169240) --- diff --git a/source3/passdb/pdb_samba_dsdb.c b/source3/passdb/pdb_samba_dsdb.c index b06267b2d64..4e55a15a0cc 100644 --- a/source3/passdb/pdb_samba_dsdb.c +++ b/source3/passdb/pdb_samba_dsdb.c @@ -3741,7 +3741,8 @@ static NTSTATUS pdb_samba_dsdb_enum_trusted_domains(struct pdb_methods *m, domains[di++] = d; } - talloc_realloc(domains, domains, struct pdb_trusted_domain *, di); + domains = talloc_realloc(domains, domains, struct pdb_trusted_domain *, + di); *_domains = talloc_move(mem_ctx, &domains); *_num_domains = di; TALLOC_FREE(tmp_ctx);