summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-30 15:49:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-30 15:49:32 +0000
commit4d683d0566a16c3a7bc0d91bb92a36358613cf63 (patch)
treea1da4f513d17d1554c64dd156720f47e70a97445 /gc.c
parented22c21a8f4e0c98045efb6de245fba79ec7e961 (diff)
merge revision(s) r48999,r49484: [Backport #10646]
* gc.c (wmap_final_func): fix memory size shortage when realloc wmap. Fix SEGV during finilize of WeakRef on Solaris (though the SEGV could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646] Fix SEGV during finalize of WeakRef on Solaris (though the SEGV git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index cc37327463..f9048e031a 100644
--- a/gc.c
+++ b/gc.c
@@ -6413,7 +6413,7 @@ wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
return ST_DELETE;
}
if (j < i) {
- ptr = ruby_sized_xrealloc2(ptr, j, sizeof(VALUE), i);
+ ptr = ruby_sized_xrealloc2(ptr, j + 1, sizeof(VALUE), i);
ptr[0] = j;
*value = (st_data_t)ptr;
}