Remove unnecessary/incorrect talloc_steal() calls
authorJonathon Reinhart <Jonathon.Reinhart@gmail.com>
Wed, 5 Feb 2020 05:25:36 +0000 (00:25 -0500)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 5 Mar 2020 18:40:16 +0000 (18:40 +0000)
commita4ed6ada500c3ee7ef8b5e43998968627121f255
tree01285afb3d3fd1c9133a542f844aa0177d50f1d7
parent0dd2a27347ba8fcd9c26aa54f36df8d33e5005ed
Remove unnecessary/incorrect talloc_steal() calls

The talloc_steal() in dsdb_enum_group_mem() is unnecessary, because
members was already allocated from the same mem_ctx.

The talloc_steal() in pdb_samba_dsdb_enum_aliasmem() is also unnecessary
for the same reason, but also incorrect, because it should be
dereferencing pmembers:

    talloc_steal(mem_ctx, *pmembers);

Furthermore, we should only assign to *pnum_members on success; otherwise
num_members is used uninitialized.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14264

Signed-off-by: Jonathon Reinhart <Jonathon.Reinhart@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar  5 18:40:16 UTC 2020 on sn-devel-184
source3/passdb/pdb_samba_dsdb.c
source4/dsdb/common/util_samr.c