summaryrefslogtreecommitdiffstats
path: root/libexec/tftpd/tftpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/tftpd/tftpd.c')
-rw-r--r--libexec/tftpd/tftpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 4267ebd..7eadc9f 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -588,7 +588,8 @@ validate_access(char **filep, int mode)
return (errno + 100);
file = fdopen(fd, (mode == RRQ)? "r":"w");
if (file == NULL) {
- return errno+100;
+ close(fd);
+ return (errno + 100);
}
return (0);
}
OpenPOWER on IntegriCloud