libprocstat: fix memory leak

Free the rlimits array on the happy path in procstat_getrlimit_core().

Reported by:	Coverity
CID:		1373328
Sponsored by:	Dell EMC
This commit is contained in:
Eric van Gyzen 2018-05-28 02:10:35 +00:00
parent 0b1f36b6c5
commit 9b20744177

View File

@ -2192,6 +2192,7 @@ procstat_getrlimit_core(struct procstat_core *core, int which,
return (-1);
}
*rlimit = rlimits[which];
free(rlimits);
return (0);
}