diff options
author | 2003-02-17 18:51:11 +0000 | |
---|---|---|
committer | 2003-02-17 18:51:11 +0000 | |
commit | b4c95005bcec1d1084d63cc3ec2a373d09fbd72f (patch) | |
tree | 0a81de156c110b317dcac56686648a43bd386c29 | |
parent | Add a -n flag and version string; from vixie (diff) | |
download | wireguard-openbsd-b4c95005bcec1d1084d63cc3ec2a373d09fbd72f.tar.xz wireguard-openbsd-b4c95005bcec1d1084d63cc3ec2a373d09fbd72f.zip |
Fix double free; Brian Poole
-rw-r--r-- | usr.bin/ftp/fetch.c | 7 |
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"); |