summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libexec/ftpd/ftpd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 1c443f5e779..4cada1a6342 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.69 2000/03/03 15:51:45 bitblt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.70 2000/04/11 11:42:11 deraadt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -1099,8 +1099,10 @@ retrieve(cmd, name)
logxfer(name, st.st_size, start);
(void) fclose(dout);
data = -1;
- pdata = -1;
done:
+ if (pdata >= 0)
+ (void) close(pdata);
+ pdata = -1;
if (cmd == 0)
LOGBYTES("get", name, byte_count);
(*closefunc)(fin);
@@ -2436,6 +2438,10 @@ send_file_list(whichf)
transflag = 0;
if (dout != NULL)
(void) fclose(dout);
+ else {
+ if (pdata >= 0)
+ close(pdata);
+ }
data = -1;
pdata = -1;
out: