diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 3 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Jul 1 11:41:12 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * string.c (tr_trans): free heap ptr when the str is not embeded. + patched by Eric Wong. [Bug #4956] [ruby-core:37708] + Fri Jul 1 08:21:28 2011 Koichi Sasada <ko1@atdot.net> * vm_insnhelper.c (vm_getivar): check vm state version @@ -4896,6 +4896,9 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) CHECK_IF_ASCII(c); t += tlen; } + if (!STR_EMBED_P(str)) { + xfree(RSTRING(str)->as.heap.ptr); + } *t = '\0'; RSTRING(str)->as.heap.ptr = buf; RSTRING(str)->as.heap.len = t - buf; @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 314 +#define RUBY_PATCHLEVEL 315 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |