summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-12-05 01:59:32 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-12-05 01:59:32 +0000
commit241a32b436f8995ade7af2a717b30704f237da11 (patch)
treeeb0df3a5fb8acb8f175df63f7f94499d68b0c8be
parentf018400b69701e710f3c78924ad4821f7fea2ef9 (diff)
downloadsamba-241a32b436f8995ade7af2a717b30704f237da11.tar.gz
samba-241a32b436f8995ade7af2a717b30704f237da11.tar.bz2
samba-241a32b436f8995ade7af2a717b30704f237da11.zip
Follow herb's suggestion and don't strdup a string to itself
(This used to be commit d00f461f43558c8ef942df305bcc2c89060b4800)
-rw-r--r--source3/utils/net_rpc_join.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index f9b3c94bfb..463de61b05 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -189,9 +189,12 @@ int net_rpc_join(int argc, const char **argv)
/* Create a random machine account password */
- clear_trust_password = generate_random_str(15);
- clear_trust_password = strdup(clear_trust_password);
-
+ {
+ char *str;
+ str = generate_random_str(15);
+ clear_trust_password = strdup(str);
+ }
+
ucs2_pw_len = push_ucs2(NULL, ucs2_trust_password,
clear_trust_password,
sizeof(ucs2_trust_password), 0);