aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2020-09-17 18:24:51 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2020-09-17 18:24:51 +0000
commitacde2586c9fa53b525ff0ff93ac6f22b0f084391 (patch)
treef264294dd191d9aec89e9d49bb265361a3e1a005
parentedd1bf93b303263ad329fd690c3e45478fc091e3 (diff)
downloadsrc-acde2586c9fa53b525ff0ff93ac6f22b0f084391.tar.gz
src-acde2586c9fa53b525ff0ff93ac6f22b0f084391.zip
Fix additional memory leak in process_mapfile
Additional Coverity detected memory leak fix. Submitted by: bret_ketchum@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
Notes
Notes: svn path=/head/; revision=365845
-rw-r--r--lib/libpmc/pmu-events/jevents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c
index e6316ac08691..7a170b17bf2b 100644
--- a/lib/libpmc/pmu-events/jevents.c
+++ b/lib/libpmc/pmu-events/jevents.c
@@ -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';