From 237cb94cf5676e8cfc81ca9f5e8d29e04e61fc4d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 24 Nov 2020 00:02:48 -0800 Subject: Handle calloc failure for cfd8c7e6ca9f923cee3a062b548d0824fc67e9a5. --- mjit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 262298d6d4..170f22396b 100644 --- a/mjit.c +++ b/mjit.c @@ -187,6 +187,8 @@ mjit_cont_new(rb_execution_context_t *ec) // When this function is called from rb_thread_alloc through rb_threadptr_root_fiber_setup, // the thread is still being prepared and marking it causes SEGV. cont = calloc(1, sizeof(struct mjit_cont)); + if (cont == NULL) + rb_memerror(); cont->ec = ec; CRITICAL_SECTION_START(3, "in mjit_cont_new"); -- cgit v1.2.3