From 7fd698d73205155e5a78fdbd91a55c649276c7a0 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Fri, 3 Oct 1997 14:00:09 +0000 Subject: Don't attempt to deref OpenConn after it's been set to NULL. :) --- release/sysinstall/ftp.c | 10 ++++++---- usr.sbin/sysinstall/ftp.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index 74fd5938b3a2..3c91b7484b8c 100644 --- a/release/sysinstall/ftp.c +++ b/release/sysinstall/ftp.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: ftp.c,v 1.32 1997/02/22 14:11:42 peter Exp $ + * $Id: ftp.c,v 1.33 1997/10/03 03:32:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -197,12 +197,14 @@ mediaGetFTP(Device *dev, char *file, Boolean probe) try = file; while ((fp = ftpGet(OpenConn, try, 0)) == NULL) { + int ftperr = ftpErrno(OpenConn); + /* If a hard fail, try to "bounce" the ftp server to clear it */ - if (ftpErrno(OpenConn) != 550) { - dev->shutdown(dev); - if (ftpErrno(OpenConn) != 421) /* Timeout? */ + if (ftperr != 550) { + if (ftperr != 421) /* Timeout? */ variable_unset(VAR_FTP_PATH); /* If we can't re-initialize, just forget it */ + dev->shutdown(dev); if (!dev->init(dev)) { netDown(dev); fclose(OpenConn); diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index 74fd5938b3a2..3c91b7484b8c 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: ftp.c,v 1.32 1997/02/22 14:11:42 peter Exp $ + * $Id: ftp.c,v 1.33 1997/10/03 03:32:03 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -197,12 +197,14 @@ mediaGetFTP(Device *dev, char *file, Boolean probe) try = file; while ((fp = ftpGet(OpenConn, try, 0)) == NULL) { + int ftperr = ftpErrno(OpenConn); + /* If a hard fail, try to "bounce" the ftp server to clear it */ - if (ftpErrno(OpenConn) != 550) { - dev->shutdown(dev); - if (ftpErrno(OpenConn) != 421) /* Timeout? */ + if (ftperr != 550) { + if (ftperr != 421) /* Timeout? */ variable_unset(VAR_FTP_PATH); /* If we can't re-initialize, just forget it */ + dev->shutdown(dev); if (!dev->init(dev)) { netDown(dev); fclose(OpenConn); -- cgit v1.3