Skip to content

Commit

Permalink
pdb: Fix CID 1427620 Resource leak
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
  • Loading branch information
vlendec authored and slowfranklin committed Jan 17, 2018
1 parent 92131d0 commit 4e5c942
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source3/passdb/pdb_samba_dsdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4e5c942

Please sign in to comment.