summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-11-16 18:15:33 +0000
committerphk <phk@FreeBSD.org>2001-11-16 18:15:33 +0000
commit1fb8368599f8504e692e24fba674e3d207fac051 (patch)
tree945ad717233e21a7251df992687fbaf930970b63 /lib/libc/stdlib
parent7be0fe02d5fe680e1e60d9aa445767874d96f7fe (diff)
downloadFreeBSD-src-1fb8368599f8504e692e24fba674e3d207fac051.zip
FreeBSD-src-1fb8368599f8504e692e24fba674e3d207fac051.tar.gz
Correctly call THREAD_UNLOCK() if the recursive call trap is sprung.
Pointed out by: knu
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/malloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index bc6769b..999c9b5 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1114,6 +1114,7 @@ free(void *ptr)
if (malloc_active++) {
wrtwarning("recursive call\n");
malloc_active--;
+ THREAD_UNLOCK();
return;
}
if (ptr != ZEROSIZEPTR)
@@ -1134,6 +1135,7 @@ realloc(void *ptr, size_t size)
if (malloc_active++) {
wrtwarning("recursive call\n");
malloc_active--;
+ THREAD_UNLOCK();
return (0);
}
if (ptr && !malloc_started) {
OpenPOWER on IntegriCloud