summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-standard
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc-standard')
-rw-r--r--libc/stdlib/malloc-standard/malloc.c2
-rw-r--r--libc/stdlib/malloc-standard/malloc.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.c b/libc/stdlib/malloc-standard/malloc.c
index 3253ebda6..2abb5bbdd 100644
--- a/libc/stdlib/malloc-standard/malloc.c
+++ b/libc/stdlib/malloc-standard/malloc.c
@@ -744,7 +744,7 @@ static void* __malloc_alloc(size_t nb, mstate av)
}
/* catch all failure paths */
- errno = ENOMEM;
+ __set_errno(ENOMEM);
return 0;
}
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index d945627c6..1a4cc5a62 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -512,7 +512,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#define checked_request2size(req, sz) \
if (REQUEST_OUT_OF_RANGE(req)) { \
- errno = ENOMEM; \
+ __set_errno(ENOMEM); \
return 0; \
} \
(sz) = request2size(req);