summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_malloc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 1998ba8022b..8a51c816f2e 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.31 2001/05/14 08:03:13 angelos Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.32 2001/06/21 14:27:13 niklas Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -341,6 +341,12 @@ free(addr, type)
return;
#endif
+#ifdef DIAGNOSTIC
+ if (addr < (void *)kmembase || addr >= (void *)kmemlimit)
+ panic("free of non-malloced addr %p type %s", addr,
+ memname[type]);
+#endif
+
kup = btokup(addr);
size = 1 << kup->ku_indx;
kbp = &bucket[kup->ku_indx];