From 33c679ba9a5af00cc7243ace1d899e221df8a719 Mon Sep 17 00:00:00 2001 From: knu Date: Fri, 20 Jul 2001 15:20:25 +0000 Subject: * gc.c (ruby_xrealloc): fix a dangling bug which led memory reallocation to fail even though the second try after a GC succeeds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 6c9a054db1..c3e62fdf35 100644 --- a/gc.c +++ b/gc.c @@ -134,11 +134,12 @@ ruby_xrealloc(ptr, size) if (!mem) { rb_gc(); RUBY_CRITICAL(mem = realloc(ptr, size)); - if (!mem) + if (!mem) { if (size >= 50 * 1024 * 1024) { rb_raise(rb_eNoMemError, "tried to re-allocate too big memory"); } mem_error("failed to allocate memory(realloc)"); + } } return mem; -- cgit v1.2.3