From 9b2074417777dc909f37ca1ab51750161c7d6d4d Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Mon, 28 May 2018 02:10:35 +0000 Subject: [PATCH] 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 --- lib/libprocstat/libprocstat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index 450ccdb5481f..99a9c50337e4 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2192,6 +2192,7 @@ procstat_getrlimit_core(struct procstat_core *core, int which, return (-1); } *rlimit = rlimits[which]; + free(rlimits); return (0); }