diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-01-23 20:42:25 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-01-23 20:42:25 +0000 |
commit | e3c6f63ee2781fb5ef9403e4d60ecc805d79182a (patch) | |
tree | 6002f47e911f1872eaa62fb746816e219b41dc35 /lib | |
parent | c832c73e3ded6f120157f5b06181c6e50c7c0f0c (diff) |
THREAD_UNLOCK() on error before returning; millert@ ok.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 2234bd64a8e..6fae6fe5651 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.45 2001/12/05 22:54:01 tdeval Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.46 2002/01/23 20:42:24 fgsch Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -1248,6 +1248,7 @@ malloc(size_t size) if (malloc_active++) { wrtwarning("recursive call.\n"); malloc_active--; + THREAD_UNLOCK(); return (0); } r = imalloc(size); @@ -1287,6 +1288,7 @@ realloc(void *ptr, size_t size) if (malloc_active++) { wrtwarning("recursive call.\n"); malloc_active--; + THREAD_UNLOCK(); return (0); } if (!ptr) { |