Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp Avoid free'ing junk. It pisses off gnumalloc.



details:   https://anonhg.NetBSD.org/src/rev/a201928617f8
branches:  trunk
changeset: 473994:a201928617f8
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 24 23:21:02 1999 +0000

description:
Avoid free'ing junk. It pisses off gnumalloc.

diffstat:

 usr.bin/ftp/util.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 9c7c7e961ca8 -r a201928617f8 usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c        Thu Jun 24 22:44:56 1999 +0000
+++ b/usr.bin/ftp/util.c        Thu Jun 24 23:21:02 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.50 1999/06/20 22:07:29 cgd Exp $    */
+/*     $NetBSD: util.c,v 1.51 1999/06/24 23:21:02 christos Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.50 1999/06/20 22:07:29 cgd Exp $");
+__RCSID("$NetBSD: util.c,v 1.51 1999/06/24 23:21:02 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -312,6 +312,7 @@
                        goto cleanup_ftp_login;
                }
                tmp[strlen(tmp) - 1] = '\0';
+               freeuser = 0;
                if (*tmp == '\0')
                        user = myname;
                else
@@ -325,21 +326,23 @@
                len = strlen(user) + 1 + strlen(host) + 1;
                nuser = xmalloc(len);
                snprintf(nuser, len, "%s@%s", user, host);
+               freeuser = 1;
                user = nuser;
-               freeuser = 1;
        }
 
        n = command("USER %s", user);
        if (n == CONTINUE) {
-               if (pass == NULL)
+               if (pass == NULL) {
+                       freepass = 0;
                        pass = getpass("Password:");
+               }
                n = command("PASS %s", pass);
        }
        if (n == CONTINUE) {
                aflag++;
                if (acct == NULL) {
+                       freeacct = 0;
                        acct = getpass("Account:");
-                       freeacct = 0;
                }
                if (acct[0] == '\0') {
                        warnx("Login failed.");



Home | Main Index | Thread Index | Old Index