svn commit: r364996 - head/lib/libpmc/pmu-events
Eric van Gyzen
vangyzen at FreeBSD.org
Mon Aug 31 16:07:41 UTC 2020
Author: vangyzen
Date: Mon Aug 31 16:07:40 2020
New Revision: 364996
URL: https://svnweb.freebsd.org/changeset/base/364996
Log:
libpmc: Fix memory leak in process_mapfile
Coverity detected memory leak fix.
Submitted by: bret_ketchum at dell.com
Reported by: Coverity
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26230
Modified:
head/lib/libpmc/pmu-events/jevents.c
Modified: head/lib/libpmc/pmu-events/jevents.c
==============================================================================
--- head/lib/libpmc/pmu-events/jevents.c Mon Aug 31 15:59:17 2020 (r364995)
+++ head/lib/libpmc/pmu-events/jevents.c Mon Aug 31 16:07:40 2020 (r364996)
@@ -794,6 +794,7 @@ process_mapfile(FILE *outfp, char *fpath)
if (!mapfp) {
pr_info("%s: Error %s opening %s\n", prog, strerror(errno),
fpath);
+ free(line);
return -1;
}
@@ -850,6 +851,8 @@ process_mapfile(FILE *outfp, char *fpath)
out:
print_mapping_table_suffix(outfp);
+ free(line);
+ fclose(mapfp);
return 0;
}
More information about the svn-src-all
mailing list