diff options
author | jbj <devnull@localhost> | 2000-09-26 22:28:09 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-09-26 22:28:09 +0000 |
commit | 4893fba6f059d6eae5a209b9883a452bd0cb3e22 (patch) | |
tree | 9cd8bc9538c606ebe1f1616a63e04124a8fbcdb0 | |
parent | 39b81b51744f848298c994611869acbfc993d545 (diff) | |
download | librpm-tizen-4893fba6f059d6eae5a209b9883a452bd0cb3e22.tar.gz librpm-tizen-4893fba6f059d6eae5a209b9883a452bd0cb3e22.tar.bz2 librpm-tizen-4893fba6f059d6eae5a209b9883a452bd0cb3e22.zip |
- fix: avoid calling getpass twice as side effect of xstrdup macro (#17672).
CVS patchset: 4179
CVS date: 2000/09/26 22:28:09
-rw-r--r-- | rpmio/url.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rpmio/url.c b/rpmio/url.c index 5a264b4ba..cbf1aaffa 100644 --- a/rpmio/url.c +++ b/rpmio/url.c @@ -221,7 +221,9 @@ static void urlFind(urlinfo *uret, int mustAsk) prompt = alloca(strlen(u->host) + strlen(u->user) + 256); sprintf(prompt, _("Password for %s@%s: "), u->user, u->host); if (u->password) xfree(u->password); - u->password = xstrdup( /*@-unrecog@*/ getpass(prompt) /*@=unrecog@*/ ); + /* XXX xstrdup has side effects. */ + u->password = /*@-unrecog@*/ getpass(prompt) /*@=unrecog@*/; + u->password = xstrdup(u->password); } if (u->proxyh == NULL) { |