From 4893fba6f059d6eae5a209b9883a452bd0cb3e22 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 26 Sep 2000 22:28:09 +0000 Subject: [PATCH] - fix: avoid calling getpass twice as side effect of xstrdup macro (#17672). CVS patchset: 4179 CVS date: 2000/09/26 22:28:09 --- rpmio/url.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpmio/url.c b/rpmio/url.c index 5a264b4..cbf1aaf 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) { -- 2.7.4