summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-05 03:27:41 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-05 03:27:41 +0000
commitb657c159e92f931c673ad6ff083d8cac3601bb3f (patch)
treed11aa61dab0dbb122f492f1d4fc3fc5cc7105772
parent83b5388b258fc9c7bb4d9885b447be233f54bd93 (diff)
merges r32349 from trunk into ruby_1_9_2.
-- * string.c (tr_trans): free heap ptr when the str is not embeded. patched by Eric Wong. [Bug #4956] [ruby-core:37708] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@34430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--string.c3
-rw-r--r--version.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d89cb8b6f..22731e2788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/string.c b/string.c
index 6f9fde11ce..3db3d6c4f6 100644
--- a/string.c
+++ b/string.c
@@ -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;
diff --git a/version.h b/version.h
index 8b0239c3f9..065e3503d1 100644
--- a/version.h
+++ b/version.h
@@ -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