aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysctl
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2006-10-12 15:31:23 +0000
committerHartmut Brandt <harti@FreeBSD.org>2006-10-12 15:31:23 +0000
commit48cd487aae0f9ec46de6e98b5243b78485191c43 (patch)
treea161c6f04b3b853e4519625ba823bdc76497e1e5 /sbin/sysctl
parent948ec60d362386263573974d691123b39f675c71 (diff)
downloadsrc-48cd487aae0f9ec46de6e98b5243b78485191c43.tar.gz
src-48cd487aae0f9ec46de6e98b5243b78485191c43.zip
Don't free the buffer with the sysctl value before printing it.
Notes
Notes: svn path=/head/; revision=163275
Diffstat (limited to 'sbin/sysctl')
-rw-r--r--sbin/sysctl/sysctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 73bf68ddd928..8ab66a3acf24 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -330,6 +330,8 @@ S_clockinfo(int l2, void *p)
warnx("S_clockinfo %d != %d", l2, sizeof(*ci));
return (0);
}
+uint32_t *x = (uint32_t *)p;
+printf("%06x %06x %06x %06x %06x\n", x[0], x[1], x[2], x[3], x[4]);
printf(hflag ? "{ hz = %'d, tick = %'d, profhz = %'d, stathz = %'d }" :
"{ hz = %d, tick = %d, profhz = %d, stathz = %d }",
ci->hz, ci->tick, ci->profhz, ci->stathz);
@@ -694,8 +696,9 @@ show_var(int *oid, int nlen)
if (func) {
if (!nflag)
printf("%s%s", name, sep);
+ i = (*func)(len, p);
free(oval);
- return ((*func)(len, p));
+ return (i);
}
/* FALLTHROUGH */
default: