Follow herb's suggestion and don't strdup a string to itself
authorAndrew Bartlett <abartlet@samba.org>
Wed, 5 Dec 2001 01:59:32 +0000 (01:59 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Dec 2001 01:59:32 +0000 (01:59 +0000)
(This used to be commit d00f461f43558c8ef942df305bcc2c89060b4800)

source3/utils/net_rpc_join.c

index f9b3c94bfb3b418d81eab1697a672372dfab73dc..463de61b05b755c81ed7c8b59b95da3ba31ae3ad 100644 (file)
@@ -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);