Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jun 2017 21:40:35 +0000 (UTC)
From:      "Stephen J. Kiernan" <stevek@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319636 - head/usr.bin/tset
Message-ID:  <201706062140.v56LeZhF017403@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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");



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