svn commit: r319636 - head/usr.bin/tset

Stephen J. Kiernan stevek at FreeBSD.org
Tue Jun 6 21:40:36 UTC 2017


Author: stevek
Date: Tue Jun  6 21:40:35 2017
New Revision: 319636
URL: https://svnweb.freebsd.org/changeset/base/319636

Log:
  The memory assigned to the local variable 'copy' needs to be freed.
  
  Found using clang's static analyzer - scan-build
  
  Submitted by:	Thomas Rix <trix at juniper.net>
  Reviewed by:	ed
  Approved by:	sjg (mentor)
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D9663

Modified:
  head/usr.bin/tset/map.c

Modified: head/usr.bin/tset/map.c
==============================================================================
--- head/usr.bin/tset/map.c	Tue Jun  6 21:08:05 2017	(r319635)
+++ head/usr.bin/tset/map.c	Tue Jun  6 21:40:35 2017	(r319636)
@@ -157,6 +157,7 @@ done:	if (port) {
 badmopt:		errx(1, "illegal -m option format: %s", copy);
 		mapp->porttype = strdup(port);
 	}
+	free(copy);
 
 #ifdef MAPDEBUG
 	(void)printf("port: %s\n", mapp->porttype ? mapp->porttype : "ANY");


More information about the svn-src-all mailing list