diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2006-02-14 11:14:12 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2006-02-14 11:14:12 +0000 |
commit | f887e9ab02f70e5fdceb4ee61003e5aa81929513 (patch) | |
tree | 6168938fc21a3f69334d6bdd97278181cf65feb6 /lib/libc | |
parent | 3e98e50cc8096e40fe7e70bc6bf7f241286fba57 (diff) |
quick path for free(0)
`looks to be safe' millert, okay tedu.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index a3babab20a4..e1e1831a94b 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.79 2005/10/10 12:00:52 espie Exp $ */ +/* $OpenBSD: malloc.c,v 1.80 2006/02/14 11:14:11 espie Exp $ */ /* * ---------------------------------------------------------------------------- @@ -1685,10 +1685,6 @@ ifree(void *ptr) u_long pidx, index; struct pdinfo *pi; - /* This is legal */ - if (ptr == NULL) - return; - if (!malloc_started) { wrtwarning("malloc() has never been called"); return; @@ -1782,6 +1778,10 @@ malloc(size_t size) void free(void *ptr) { + /* This is legal. XXX quick path */ + if (ptr == NULL) + return; + _MALLOC_LOCK(); malloc_func = " in free():"; if (malloc_active++) { |