From: Andreas Schneider Date: Thu, 6 Jun 2024 15:37:32 +0000 (+0200) Subject: s3:utils: Use talloc instead of malloc functions X-Git-Tag: tdb-1.4.11~425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d73bb4acd7cf062b9fd1a9ea6721e41a5e721fb;p=thirdparty%2Fsamba.git s3:utils: Use talloc instead of malloc functions Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Jun 6 21:32:53 UTC 2024 on atb-devel-224 --- diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 066585cb994..b04be2efea7 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -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);