summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ftp/complete.c7
-rw-r--r--usr.bin/ftp/fetch.c16
-rw-r--r--usr.bin/ftp/ftp.c7
3 files changed, 12 insertions, 18 deletions
diff --git a/usr.bin/ftp/complete.c b/usr.bin/ftp/complete.c
index e8232d92bf5..183cdff33d6 100644
--- a/usr.bin/ftp/complete.c
+++ b/usr.bin/ftp/complete.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: complete.c,v 1.18 2006/04/25 05:45:20 tedu Exp $ */
+/* $OpenBSD: complete.c,v 1.19 2006/06/23 20:35:25 steven Exp $ */
/* $NetBSD: complete.c,v 1.10 1997/08/18 10:20:18 lukem Exp $ */
/*-
@@ -39,7 +39,7 @@
#ifndef SMALL
#ifndef lint
-static const char rcsid[] = "$OpenBSD: complete.c,v 1.18 2006/04/25 05:45:20 tedu Exp $";
+static const char rcsid[] = "$OpenBSD: complete.c,v 1.19 2006/06/23 20:35:25 steven Exp $";
#endif /* not lint */
/*
@@ -236,8 +236,7 @@ complete_remote(char *word, int list)
if (dirchange || strcmp(dir, lastdir) != 0) { /* dir not cached */
char *emesg;
- if (dirlist != NULL)
- sl_free(dirlist, 1);
+ sl_free(dirlist, 1);
dirlist = sl_init();
mflag = 1;
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 4b227dcde9a..7435d736239 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.66 2006/06/01 22:42:11 ray Exp $ */
+/* $OpenBSD: fetch.c,v 1.67 2006/06/23 20:35:25 steven Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: fetch.c,v 1.66 2006/06/01 22:42:11 ray Exp $";
+static const char rcsid[] = "$OpenBSD: fetch.c,v 1.67 2006/06/23 20:35:25 steven Exp $";
#endif /* not lint and not SMALL */
/*
@@ -534,12 +534,10 @@ again:
fclose(fin);
else if (s != -1)
close(s);
- if (proxyurl)
- free(proxyurl);
+ free(proxyurl);
free(newline);
rval = url_get(cp, proxyenv, outfile);
- if (buf)
- free(buf);
+ free(buf);
return (rval);
}
}
@@ -636,10 +634,8 @@ cleanup_url_get:
fclose(fin);
else if (s != -1)
close(s);
- if (buf)
- free(buf);
- if (proxyurl)
- free(proxyurl);
+ free(buf);
+ free(proxyurl);
free(newline);
return (rval);
}
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index da02f9d09ea..7f58335d237 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.64 2006/05/16 23:43:16 ray Exp $ */
+/* $OpenBSD: ftp.c,v 1.65 2006/06/23 20:35:25 steven Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -60,7 +60,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: ftp.c,v 1.64 2006/05/16 23:43:16 ray Exp $";
+static const char rcsid[] = "$OpenBSD: ftp.c,v 1.65 2006/06/23 20:35:25 steven Exp $";
#endif /* not lint and not SMALL */
#include <sys/types.h>
@@ -923,8 +923,7 @@ recvrequest(const char *cmd, const char * volatile local, const char *remote,
if (fstat(fileno(fout), &st) < 0 || st.st_blksize == 0)
st.st_blksize = BUFSIZ;
if (st.st_blksize > bufsize) {
- if (buf)
- (void)free(buf);
+ (void)free(buf);
buf = malloc((unsigned)st.st_blksize);
if (buf == NULL) {
warn("malloc");