summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaan <daanl@outlook.com>2022-04-07 13:02:40 -0700
committerDaan <daanl@outlook.com>2022-04-07 13:02:40 -0700
commit82dd094ec4d7f36067fdd55aa10aea438dae588f (patch)
tree4740519a272c79b569c1b3b9dadbc663545763fb
parenta799b214a2429908cbfcb6e083b1606869c96696 (diff)
fix assertion failure with mixed pointer errors
-rw-r--r--src/alloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index cd4afa1..5f150f2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -470,6 +470,7 @@ static inline mi_segment_t* mi_checked_ptr_segment(const void* p, const char* ms
#if (MI_DEBUG>0 || MI_SECURE>=4)
if (mi_unlikely(_mi_ptr_cookie(segment) != segment->cookie)) {
_mi_error_message(EINVAL, "%s: pointer does not point to a valid heap space: %p\n", msg, p);
+ return NULL;
}
#endif
return segment;