Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2018 17:20:31 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337779 - head/usr.bin/tftp
Message-ID:  <201808141720.w7EHKVTA011265@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808141720.w7EHKVTA011265>