From b04814bf711ed170c674ca874d28dba8faed9484 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 10 Jan 2012 06:14:42 +0000 Subject: * ext/readline/readline.c (readline_attempted_completion_function): use rb_memerror(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/readline/readline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/readline') diff --git a/ext/readline/readline.c b/ext/readline/readline.c index d00fc049ac..423e58508b 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -672,7 +672,7 @@ readline_attempted_completion_function(const char *text, int start, int end) matches = RARRAY_LEN(ary); if (matches == 0) return NULL; result = (char**)malloc((matches + 2)*sizeof(char*)); - if (result == NULL) rb_raise(rb_eNoMemError, "failed to allocate memory"); + if (result == NULL) rb_memerror(); for (i = 0; i < matches; i++) { temp = rb_obj_as_string(RARRAY_PTR(ary)[i]); result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1); -- cgit v1.2.3