summaryrefslogtreecommitdiffstats
path: root/libexec/tftpd
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2004-05-25 01:40:27 +0000
committermdodd <mdodd@FreeBSD.org>2004-05-25 01:40:27 +0000
commit8c3c3c59d7034a1faa8fb4c5373d57ed4f9b9930 (patch)
treeb97fb2c20b88013ef1f6732822fd63ea301f42bc /libexec/tftpd
parent5388d45e098d7bc7db9b004fefedce09e3305de9 (diff)
downloadFreeBSD-src-8c3c3c59d7034a1faa8fb4c5373d57ed4f9b9930.zip
FreeBSD-src-8c3c3c59d7034a1faa8fb4c5373d57ed4f9b9930.tar.gz
- Close fd if fdopen(fd) fails.
- Format return () to resemble the one 5 lines up.
Diffstat (limited to 'libexec/tftpd')
-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