summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--headers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/headers.c b/headers.c
index ea83378e..108adf18 100644
--- a/headers.c
+++ b/headers.c
@@ -133,7 +133,9 @@ GC_INNER ptr_t GC_scratch_alloc(size_t bytes)
result = (ptr_t)GET_MEM(bytes_to_get);
GC_add_to_our_memory(result, bytes_to_get);
scratch_free_ptr -= bytes;
- GC_scratch_last_end_ptr = result + bytes;
+ if (result != NULL) {
+ GC_scratch_last_end_ptr = result + bytes;
+ }
return(result);
}