summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-05-09 07:13:16 +0000
committerjkh <jkh@FreeBSD.org>1996-05-09 07:13:16 +0000
commitc55a4da98078442d79cdd2aa2aa3ffc0f487f318 (patch)
treeee04b5cb53600a192054a29f6537a94d4f120c04 /usr.sbin/pstat
parent00a71a5dd6c73f21950297fbc1ef710c31e28231 (diff)
downloadFreeBSD-src-c55a4da98078442d79cdd2aa2aa3ffc0f487f318.zip
FreeBSD-src-c55a4da98078442d79cdd2aa2aa3ffc0f487f318.tar.gz
Properly free up resources allocated in swapmode(). This is not quite
the patch submitted by Philippe Charnier since he wasn't actually freeing the resources early enough (an earlier return could be invoked, leaving the resources still allocated), but he definitely pointed it out. Merci, Philippe! Suggested-By: Philippe Charnier <charnier@lirmm.fr>
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r--usr.sbin/pstat/pstat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index 92d76f7..e7427ce 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1157,6 +1157,8 @@ swapmode()
* need to bother with totals.
*/
used = avail - nfree;
+ free(sw);
+ free(perdev);
if (totalflag) {
(void)printf("%dM/%dM swap space\n", used / 2048, avail / 2048);
return;
OpenPOWER on IntegriCloud