diff options
author | 2002-01-23 20:42:24 +0000 | |
---|---|---|
committer | 2002-01-23 20:42:24 +0000 | |
commit | ccecf317ed2aad28612d8c175abdaac339726213 (patch) | |
tree | 35c8969cd8e587392661d96062096009686e21ca /lib/libc/stdlib | |
parent | fix a bug in az_find and make az_staet() more readable; from Vladimir Popov <jumbo@narod.ru> (diff) | |
download | wireguard-openbsd-ccecf317ed2aad28612d8c175abdaac339726213.tar.xz wireguard-openbsd-ccecf317ed2aad28612d8c175abdaac339726213.zip |
THREAD_UNLOCK() on error before returning; millert@ ok.
Diffstat (limited to 'lib/libc/stdlib')
-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) { |