1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +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; goto out;
} }
domain_name = smb_xstrdup(argv[0]); domain_name = talloc_strdup_upper(frame, argv[0]);
if (!strupper_m(domain_name)) { if (domain_name == NULL) {
SAFE_FREE(domain_name);
goto out; goto out;
} }
/* account name used at first is our domain's name with '$' */ /* account name used at first is our domain's name with '$' */
if (asprintf(&acct_name, "%s$", lp_workgroup()) == -1) { acct_name = talloc_asprintf_strupper_m(frame, "%s$", lp_workgroup());
goto out; if (acct_name == NULL) {
}
if (!strupper_m(acct_name)) {
SAFE_FREE(domain_name);
SAFE_FREE(acct_name);
goto out; goto out;
} }
cli_credentials_set_username(c->creds, acct_name, CRED_SPECIFIED); cli_credentials_set_username(c->creds, acct_name, CRED_SPECIFIED);