Source-Changes-HG archive

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

[src/trunk]: src/sbin/sysctl Allocate adjusted size, not fixed size.



details:   https://anonhg.NetBSD.org/src/rev/193ff3fbea9a
branches:  trunk
changeset: 565912:193ff3fbea9a
user:      atatat <atatat%NetBSD.org@localhost>
date:      Fri Apr 23 12:03:39 2004 +0000

description:
Allocate adjusted size, not fixed size.

diffstat:

 sbin/sysctl/sysctl.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 62173154f7ab -r 193ff3fbea9a sbin/sysctl/sysctl.c
--- a/sbin/sysctl/sysctl.c      Fri Apr 23 12:02:43 2004 +0000
+++ b/sbin/sysctl/sysctl.c      Fri Apr 23 12:03:39 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.c,v 1.92 2004/04/22 03:56:31 atatat Exp $ */
+/*     $NetBSD: sysctl.c,v 1.93 2004/04/23 12:03:39 atatat Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 #if 0
 static char sccsid[] = "@(#)sysctl.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.92 2004/04/22 03:56:31 atatat Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.93 2004/04/23 12:03:39 atatat Exp $");
 #endif
 #endif /* not lint */
 
@@ -1456,7 +1456,7 @@
         */
        i = 0;
        do {
-               d = malloc(128 * pnode->sysctl_clen);
+               d = malloc(sz);
                if (d == NULL)
                        return;
                rc = sysctl(name, namelen + 1, d, &sz, NULL, 0);



Home | Main Index | Thread Index | Old Index