diff options
author | Samuel Cabrero <scabrero@suse.de> | 2022-06-13 16:53:32 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-06-27 15:50:30 +0000 |
commit | 633ccc55c0670cfe663ab7bf119feb8b22c92794 (patch) | |
tree | 60ec2420ece0d2fa60734f628e4724deec31a093 /source3/lib/netapi | |
parent | d64335eaef5ad690ea923a8e6656b9185a54d9fa (diff) | |
download | samba-633ccc55c0670cfe663ab7bf119feb8b22c92794.tar.gz |
s3:libads: Allocate ads->auth.user_name under ADS_STRUCT talloc context
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 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index aa0cefe163e..ced16031d44 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -434,15 +434,23 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx, goto out; } - SAFE_FREE(ads->auth.user_name); + TALLOC_FREE(ads->auth.user_name); if (r->in.account) { - ads->auth.user_name = SMB_STRDUP(r->in.account); + ads->auth.user_name = talloc_strdup(ads, r->in.account); + if (ads->auth.user_name == NULL) { + ret = WERR_NOT_ENOUGH_MEMORY; + goto out; + } } else { const char *username = NULL; libnetapi_get_username(ctx, &username); if (username != NULL) { - ads->auth.user_name = SMB_STRDUP(username); + ads->auth.user_name = talloc_strdup(ads, username); + if (ads->auth.user_name == NULL) { + ret = WERR_NOT_ENOUGH_MEMORY; + goto out; + } } } |