From 3ad35109b293e2a109da1dd761ef20928fd0cc02 Mon Sep 17 00:00:00 2001 From: vangyzen Date: Thu, 17 Sep 2020 18:24:51 +0000 Subject: [PATCH] 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 --- lib/libpmc/pmu-events/jevents.c | 2 ++ 1 file changed, 2 insertions(+) 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';