libpmc: Fix memory leak in process_mapfile

Coverity detected memory leak fix.

Submitted by:	bret_ketchum@dell.com
Reported by:	Coverity
Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26230
This commit is contained in:
Eric van Gyzen 2020-08-31 16:07:40 +00:00
parent 0a01415e6e
commit 4644463cac

View File

@ -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;
}