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);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to