Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2018 02:10:35 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334267 - head/lib/libprocstat
Message-ID:  <201805280210.w4S2AZaQ060383@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vangyzen
Date: Mon May 28 02:10:35 2018
New Revision: 334267
URL: https://svnweb.freebsd.org/changeset/base/334267

Log:
  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

Modified:
  head/lib/libprocstat/libprocstat.c

Modified: head/lib/libprocstat/libprocstat.c
==============================================================================
--- head/lib/libprocstat/libprocstat.c	Mon May 28 01:59:48 2018	(r334266)
+++ head/lib/libprocstat/libprocstat.c	Mon May 28 02:10:35 2018	(r334267)
@@ -2192,6 +2192,7 @@ procstat_getrlimit_core(struct procstat_core *core, in
 		return (-1);
 	}
 	*rlimit = rlimits[which];
+	free(rlimits);
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805280210.w4S2AZaQ060383>