diff --git a/signal.c b/signal.c index 764031e78a..4ca52b2ee6 100644 --- a/signal.c +++ b/signal.c @@ -557,10 +557,13 @@ static int rb_sigaltstack_size_value = 0; void * rb_allocate_sigaltstack(void) { + void *altstack; if (!rb_sigaltstack_size_value) { rb_sigaltstack_size_value = rb_sigaltstack_size(); } - return xmalloc(rb_sigaltstack_size_value); + altstack = malloc(rb_sigaltstack_size_value); + if (!altstack) rb_memerror(); + return altstack; } /* alternate stack for SIGSEGV */ diff --git a/vm_core.h b/vm_core.h index 5db3080b43..2962356212 100644 --- a/vm_core.h +++ b/vm_core.h @@ -136,7 +136,7 @@ void *rb_allocate_sigaltstack(void); void *rb_register_sigaltstack(void *); # define RB_ALTSTACK_INIT(var, altstack) var = rb_register_sigaltstack(altstack) -# define RB_ALTSTACK_FREE(var) xfree(var) +# define RB_ALTSTACK_FREE(var) free(var) # define RB_ALTSTACK(var) var #else /* noop */ # define RB_ALTSTACK_INIT(var, altstack)