diff options
author | Samuel Cabrero <scabrero@samba.org> | 2022-05-26 17:28:34 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-06-27 15:50:30 +0000 |
commit | d0dc0171ad6abd969e834f8eb2bbfc08bef4547a (patch) | |
tree | 7291496f38d5f26f4b3e4d822a87350b54193f0c /source3/lib/netapi | |
parent | 50934b85ffe57ba35e6558a2b54097e64f464419 (diff) | |
download | samba-d0dc0171ad6abd969e834f8eb2bbfc08bef4547a.tar.gz |
s3:libads: Allocate ADS_STRUCT under a talloc context
The ads_destroy() function is now static and only called from the
ADS_STRUCT destructor.
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r-- | source3/lib/netapi/joindomain.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 7eba430d8a0..7438e8407be 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -424,7 +424,8 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx, dc = strip_hostname(info->dc_unc); - ads = ads_init(info->domain_name, + ads = ads_init(tmp_ctx, + info->domain_name, info->domain_name, dc, ADS_SASL_PLAIN); @@ -459,22 +460,18 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx, ads_status = ads_connect_user_creds(ads); if (!ADS_ERR_OK(ads_status)) { - ads_destroy(&ads); ret = WERR_NERR_DEFAULTJOINREQUIRED; goto out; } ads_status = ads_get_joinable_ous(ads, ctx, &p, &s); if (!ADS_ERR_OK(ads_status)) { - ads_destroy(&ads); ret = WERR_NERR_DEFAULTJOINREQUIRED; goto out; } *r->out.ous = discard_const_p(const char *, p); *r->out.ou_count = s; - ads_destroy(&ads); - ret = WERR_OK; out: TALLOC_FREE(tmp_ctx); |