From 9423ac9b4f3731faf92c9a688a043f04742b4eb1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 28 Jul 2002 02:17:57 +0000 Subject: Clean this code up a little. If it's alrady asprintf()ed, I see no need for a manual strdup() too... (This used to be commit 71452365c8d9aa3d06b64716636a32bfebd3d4f8) --- source3/utils/net_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/utils/net_rpc.c') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 120916d7b4..a13a8c5e22 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -1605,8 +1605,7 @@ static int rpc_trustdom_establish(int argc, const char **argv) asprintf(&acct_name, "%s$", lp_workgroup()); strupper(acct_name); - opt_user_name = (char*)malloc(strlen(acct_name) + 1); - safe_strcpy(opt_user_name, acct_name, strlen(acct_name) + 1); + opt_user_name = acct_name; /* find the domain controller */ if (!net_find_dc(&server_ip, pdc_name, domain_name)) { @@ -1708,6 +1707,8 @@ static int rpc_trustdom_establish(int argc, const char **argv) } + + /* There should be actually query info level 3 (following nt serv behaviour), but I still don't know if it's _really_ necessary */ -- cgit