summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-09-20 21:26:21 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-09-20 21:26:21 +0000
commit30aa74207c6d018a5f40d9e2aad932a154b7a783 (patch)
tree00c0b268f1e0517a74139851e6c2814f996045c1
parentded82b6cdd1812cf2f58c2cf720497dca885c969 (diff)
Recommit memory leak fix.
-rw-r--r--usr.bin/top/machine.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 697de570ee4..20e3b39eac0 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.52 2006/04/29 14:40:44 otto Exp $ */
+/* $OpenBSD: machine.c,v 1.53 2006/09/20 21:26:20 ray Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -725,8 +725,10 @@ swapmode(int *used, int *total)
return 0;
rnswap = swapctl(SWAP_STATS, swdev, nswap);
- if (rnswap == -1)
+ if (rnswap == -1) {
+ free(swdev);
return 0;
+ }
/* if rnswap != nswap, then what? */