Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167294735
D57071.id178405.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
744 B
Referenced Files
None
Subscribers
None
D57071.id178405.diff
View Options
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -584,8 +584,11 @@
if (verbose)
printf("getting from %s:%s to %s [%s]\n",
hostname, src, cp, mode);
- if (recvfile(peer, port, fd, src, mode) != 0)
+ if (recvfile(peer, port, fd, src, mode) != 0) {
+ (void) unlink(cp);
txrx_error = 1;
+ }
+ close(fd);
break;
}
cp = tail(src); /* new .. jdg */
@@ -597,8 +600,11 @@
if (verbose)
printf("getting from %s:%s to %s [%s]\n",
hostname, src, cp, mode);
- if (recvfile(peer, port, fd, src, mode) != 0)
+ if (recvfile(peer, port, fd, src, mode) != 0) {
+ (void) unlink(cp);
txrx_error = 1;
+ }
+ close(fd);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 21, 5:54 PM (15 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33328963
Default Alt Text
D57071.id178405.diff (744 B)
Attached To
Mode
D57071: tftp: Close files when we're done with them
Attached
Detach File
Event Timeline
Log In to Comment