svn commit: r337779 - head/usr.bin/tftp

Alan Somers asomers at FreeBSD.org
Tue Aug 14 17:20:32 UTC 2018


Author: asomers
Date: Tue Aug 14 17:20:31 2018
New Revision: 337779
URL: https://svnweb.freebsd.org/changeset/base/337779

Log:
  tftp: Close a resource leak when putting files
  
  Reported by:	Coverity
  CID:		1394842
  MFC after:	2 weeks

Modified:
  head/usr.bin/tftp/main.c

Modified: head/usr.bin/tftp/main.c
==============================================================================
--- head/usr.bin/tftp/main.c	Tue Aug 14 17:19:49 2018	(r337778)
+++ head/usr.bin/tftp/main.c	Tue Aug 14 17:20:31 2018	(r337779)
@@ -499,6 +499,7 @@ put(int argc, char *argv[])
 			printf("putting %s to %s:%s [%s]\n",
 			    cp, hostname, targ, mode);
 		xmitfile(peer, port, fd, targ, mode);
+		close(fd);
 		return;
 	}
 				/* this assumes the target is a directory */


More information about the svn-src-head mailing list