summaryrefslogtreecommitdiff
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 74a4aab6b9f..34a976613a3 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.101 2013/05/31 20:44:10 tedu Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.102 2013/07/04 17:35:52 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -376,6 +376,9 @@ free(void *addr, int type)
struct kmemstats *ksp = &kmemstats[type];
#endif
+ if (addr == NULL)
+ return;
+
#ifdef MALLOC_DEBUG
if (debug_free(addr, type))
return;