summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-12-05 01:58:33 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-12-05 01:58:33 +0000
commitf018400b69701e710f3c78924ad4821f7fea2ef9 (patch)
tree4302d443ea2cebc3ee6de9fac92050bc41e9b96f /source3
parent50b94eed80b6ff84a532129dc35aa5949a4d3a82 (diff)
downloadsamba-f018400b69701e710f3c78924ad4821f7fea2ef9.tar.gz
samba-f018400b69701e710f3c78924ad4821f7fea2ef9.tar.bz2
samba-f018400b69701e710f3c78924ad4821f7fea2ef9.zip
Follow herb's suggestion and don't strdup a string to itself.
(This used to be commit ea76a687fc2614912fd6b0458622495f9920749e)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_ads.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 1bfd5c637a..a1ea063b20 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -156,6 +156,7 @@ static int net_ads_join(int argc, const char **argv)
ADS_STRUCT *ads;
int rc;
char *password;
+ char *tmp_password;
extern pstring global_myname;
NTSTATUS status;
@@ -163,9 +164,10 @@ static int net_ads_join(int argc, const char **argv)
DEBUG(1,("Failed to initialise secrets database\n"));
return -1;
}
-
- password = generate_random_str(15);
- password = strdup(password);
+
+
+ tmp_password = generate_random_str(15);
+ password = strdup(tmp_password);
if (!(ads = ads_startup())) return -1;