From fb59e630f65ba0bcaf3f379730faf9bf35e73618 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Thu, 9 May 1996 07:13:16 +0000 Subject: [PATCH] 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 --- usr.sbin/pstat/pstat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 92d76f7ceee5..e7427cec51d8 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;