summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/fetch.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-02-17 18:51:12 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-02-17 18:51:12 +0000
commit1232f23b762f38894dceecbc183d9a2f5ceacae4 (patch)
tree2b4f54c033cf4eec3126ceb775ee9906f1074c81 /usr.bin/ftp/fetch.c
parent16928aa0b6ec9a54be1fd7bbf6a14f532146c8e6 (diff)
Fix double free; Brian Poole
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r--usr.bin/ftp/fetch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index a845655b016..c56d972e69c 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.42 2002/12/30 23:04:42 deraadt Exp $ */
+/* $OpenBSD: fetch.c,v 1.43 2003/02/17 18:51:11 millert Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.42 2002/12/30 23:04:42 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.43 2003/02/17 18:51:11 millert Exp $";
#endif /* not lint */
/*
@@ -468,7 +468,6 @@ again:
return (rval);
}
}
- free(buf);
/* Open the output file. */
if (strcmp(savefile, "-") != 0) {
@@ -493,6 +492,8 @@ again:
hashbytes = mark;
progressmeter(-1);
+ free(buf);
+
/* Finally, suck down the file. */
if ((buf = malloc(4096)) == NULL)
errx(1, "Can't allocate memory for transfer buffer\n");