diff options
author | fgsch <> | 2002-01-23 20:42:24 +0000 |
---|---|---|
committer | fgsch <> | 2002-01-23 20:42:24 +0000 |
commit | ab924303d6835c8358e1692ebf125fc53604d812 (patch) | |
tree | 98b192f84e249797a313f7324bca3c2ea42ca701 /src | |
parent | b563003e8e94328d7af626286358262921cc7175 (diff) | |
download | openbsd-ab924303d6835c8358e1692ebf125fc53604d812.tar.gz openbsd-ab924303d6835c8358e1692ebf125fc53604d812.tar.bz2 openbsd-ab924303d6835c8358e1692ebf125fc53604d812.zip |
THREAD_UNLOCK() on error before returning; millert@ ok.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 2234bd64a8..6fae6fe565 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #if defined(LIBC_SCCS) && !defined(lint) | 10 | #if defined(LIBC_SCCS) && !defined(lint) |
11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.45 2001/12/05 22:54:01 tdeval Exp $"; | 11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.46 2002/01/23 20:42:24 fgsch Exp $"; |
12 | #endif /* LIBC_SCCS and not lint */ | 12 | #endif /* LIBC_SCCS and not lint */ |
13 | 13 | ||
14 | /* | 14 | /* |
@@ -1248,6 +1248,7 @@ malloc(size_t size) | |||
1248 | if (malloc_active++) { | 1248 | if (malloc_active++) { |
1249 | wrtwarning("recursive call.\n"); | 1249 | wrtwarning("recursive call.\n"); |
1250 | malloc_active--; | 1250 | malloc_active--; |
1251 | THREAD_UNLOCK(); | ||
1251 | return (0); | 1252 | return (0); |
1252 | } | 1253 | } |
1253 | r = imalloc(size); | 1254 | r = imalloc(size); |
@@ -1287,6 +1288,7 @@ realloc(void *ptr, size_t size) | |||
1287 | if (malloc_active++) { | 1288 | if (malloc_active++) { |
1288 | wrtwarning("recursive call.\n"); | 1289 | wrtwarning("recursive call.\n"); |
1289 | malloc_active--; | 1290 | malloc_active--; |
1291 | THREAD_UNLOCK(); | ||
1290 | return (0); | 1292 | return (0); |
1291 | } | 1293 | } |
1292 | if (!ptr) { | 1294 | if (!ptr) { |