summaryrefslogtreecommitdiffstats
path: root/usr.bin/ftp/fetch.c
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2021-02-25 20:51:55 +0000
committernaddy <naddy@openbsd.org>2021-02-25 20:51:55 +0000
commita0c22864aaf49639d92dbf8f5ad7b104b51abe3b (patch)
tree95488a618fd290bb27e50d8983f9d88a194b03d3 /usr.bin/ftp/fetch.c
parentConstify cipher API. (diff)
downloadwireguard-openbsd-a0c22864aaf49639d92dbf8f5ad7b104b51abe3b.tar.xz
wireguard-openbsd-a0c22864aaf49639d92dbf8f5ad7b104b51abe3b.zip
ftp: prevent double free() in error path
Reported by bentley@; ok bentley@ jca@
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r--usr.bin/ftp/fetch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index c5b1d18cb5b..4b8b6d5c85d 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.201 2021/02/16 16:27:34 naddy Exp $ */
+/* $OpenBSD: fetch.c,v 1.202 2021/02/25 20:51:55 naddy Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -1002,6 +1002,7 @@ noslash:
}
}
free(buf);
+ buf = NULL;
/* Content-Length should be ignored for Transfer-Encoding: chunked */
if (chunked)