1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:utils: Use talloc instead of malloc functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  6 21:32:53 UTC 2024 on atb-devel-224
This commit is contained in:
Andreas Schneider 2024-06-06 17:37:32 +02:00 committed by Andrew Bartlett
parent b9d93eccbc
commit 5d73bb4acd

View File

@ -6566,19 +6566,14 @@ static int rpc_trustdom_establish(struct net_context *c, int argc,
goto out;
}
domain_name = smb_xstrdup(argv[0]);
if (!strupper_m(domain_name)) {
SAFE_FREE(domain_name);
domain_name = talloc_strdup_upper(frame, argv[0]);
if (domain_name == NULL) {
goto out;
}
/* account name used at first is our domain's name with '$' */
if (asprintf(&acct_name, "%s$", lp_workgroup()) == -1) {
goto out;
}
if (!strupper_m(acct_name)) {
SAFE_FREE(domain_name);
SAFE_FREE(acct_name);
acct_name = talloc_asprintf_strupper_m(frame, "%s$", lp_workgroup());
if (acct_name == NULL) {
goto out;
}
cli_credentials_set_username(c->creds, acct_name, CRED_SPECIFIED);