svn commit: r365845 - head/lib/libpmc/pmu-events

Eric van Gyzen vangyzen at FreeBSD.org
Thu Sep 17 18:24:52 UTC 2020


Author: vangyzen
Date: Thu Sep 17 18:24:51 2020
New Revision: 365845
URL: https://svnweb.freebsd.org/changeset/base/365845

Log:
  Fix additional memory leak in process_mapfile
  
  Additional Coverity detected memory leak fix.
  
  Submitted by:	bret_ketchum at dell.com
  Reported by:	Coverity
  Reviewed by:	cem, emaste
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D26462

Modified:
  head/lib/libpmc/pmu-events/jevents.c

Modified: head/lib/libpmc/pmu-events/jevents.c
==============================================================================
--- head/lib/libpmc/pmu-events/jevents.c	Thu Sep 17 18:06:57 2020	(r365844)
+++ head/lib/libpmc/pmu-events/jevents.c	Thu Sep 17 18:24:51 2020	(r365845)
@@ -821,6 +821,8 @@ process_mapfile(FILE *outfp, char *fpath)
 			/* TODO Deal with lines longer than 16K */
 			pr_info("%s: Mapfile %s: line %d too long, aborting\n",
 					prog, fpath, line_num);
+			free(line);
+			fclose(mapfp);
 			return -1;
 		}
 		line[strlen(line)-1] = '\0';


More information about the svn-src-head mailing list