summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-10-12 22:08:32 +0000
committerderaadt <deraadt@openbsd.org>2020-10-12 22:08:32 +0000
commit87afc19ed9256ae3cb7c5266911abf02218c2a35 (patch)
tree5accbaf0292e5c1fca2cd342ddcac4906b6e95f9 /lib/libc/stdlib/malloc.c
parentannoying whitespace (diff)
downloadwireguard-openbsd-87afc19ed9256ae3cb7c5266911abf02218c2a35.tar.xz
wireguard-openbsd-87afc19ed9256ae3cb7c5266911abf02218c2a35.zip
make fixed-sized fixed-value mib[] arrays be const
ok guenther tb millert
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index a62bfac3e5e..86670fca876 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.265 2020/10/09 16:01:48 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.266 2020/10/12 22:08:33 deraadt Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -406,7 +406,8 @@ static void
omalloc_init(void)
{
char *p, *q, b[16];
- int i, j, mib[2];
+ int i, j;
+ const int mib[2] = { CTL_VM, VM_MALLOC_CONF };
size_t sb;
/*
@@ -419,8 +420,6 @@ omalloc_init(void)
for (i = 0; i < 3; i++) {
switch (i) {
case 0:
- mib[0] = CTL_VM;
- mib[1] = VM_MALLOC_CONF;
sb = sizeof(b);
j = sysctl(mib, 2, b, &sb, NULL, 0);
if (j != 0)