summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/RtsUtils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index a8efe7928e..518d464040 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -95,6 +95,9 @@ static void addAllocation(void *addr, size_t len) {
Allocated *a;
size_t alloc_size;
+ if (allocs == NULL) {
+ barf("addAllocation: allocator debugger not initialised");
+ }
alloc_size = sizeof(Allocated);
if ((a = (Allocated *) malloc(alloc_size)) == NULL) {
/* don't fflush(stdout); WORKAROUND bug in Linux glibc */
@@ -112,6 +115,9 @@ static void addAllocation(void *addr, size_t len) {
static void removeAllocation(void *addr) {
Allocated *prev, *a;
+ if (allocs == NULL) {
+ barf("addAllocation: allocator debugger not initialised");
+ }
if (addr == NULL) {
barf("Freeing NULL!");
}