libpmc: free allocated string on return from pmc_allocate

Reported by:	Coverity
CID: 1391359
This commit is contained in:
Matt Macy 2018-05-29 18:26:12 +00:00
parent b99aa0fbb2
commit 731ca83529
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334345

View file

@ -2797,6 +2797,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) {
if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0)
return (errno);
free(spec_copy);
*pmcid = pmc_config.pm_pmcid;
return (0);
} else {