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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 174dc01bd..fbc14924e 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -20,6 +20,7 @@
#include <errno.h>
#include <string.h>
#include <malloc.h>
+#include <stdlib.h>
#ifdef __UCLIBC_HAS_THREADS__
@@ -645,6 +646,8 @@ typedef struct malloc_chunk* mbinptr;
#define unlink(P, BK, FD) { \
FD = P->fd; \
BK = P->bk; \
+ if (FD->bk != P || BK->fd != P) \
+ abort(); \
FD->bk = BK; \
BK->fd = FD; \
}