Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pstat Always free memroy allocated by loadvnodes().



details:   https://anonhg.NetBSD.org/src/rev/516a0dae6d0b
branches:  trunk
changeset: 522590:516a0dae6d0b
user:      enami <enami%NetBSD.org@localhost>
date:      Fri Feb 22 05:21:01 2002 +0000

description:
Always free memroy allocated by loadvnodes().

diffstat:

 usr.sbin/pstat/pstat.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 362d14308256 -r 516a0dae6d0b usr.sbin/pstat/pstat.c
--- a/usr.sbin/pstat/pstat.c    Fri Feb 22 05:08:16 2002 +0000
+++ b/usr.sbin/pstat/pstat.c    Fri Feb 22 05:21:01 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pstat.c,v 1.67 2002/02/22 05:04:43 enami Exp $ */
+/*     $NetBSD: pstat.c,v 1.68 2002/02/22 05:21:01 enami Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)pstat.c    8.16 (Berkeley) 5/9/95";
 #else
-__RCSID("$NetBSD: pstat.c,v 1.67 2002/02/22 05:04:43 enami Exp $");
+__RCSID("$NetBSD: pstat.c,v 1.68 2002/02/22 05:21:01 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -312,7 +312,7 @@
        e_vnodebase = loadvnodes(&numvnodes);
        if (totalflag) {
                (void)printf("%7d vnodes\n", numvnodes);
-               return;
+               goto out;
        }
        endvnode = e_vnodebase + numvnodes * (VPTRSZ + VNODESZ);
        (void)printf("%d active vnodes\n", numvnodes);
@@ -360,6 +360,8 @@
                        (*vnode_fsprint)(vp, ovflw);
                (void)printf("\n");
        }
+
+ out:
        free(e_vnodebase);
 }
 



Home | Main Index | Thread Index | Old Index