summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-10 06:50:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-10 06:50:18 +0000
commitb2fa1cbeda1b7893910205f38733430f521c3744 (patch)
tree0ed8dc323fd608bcb19fa18e1114351f8927eaf6 /string.c
parentb814252d728cb08f159da1777feca4f8e9362327 (diff)
1.1b7 pre2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@68 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 220f6f1bfbc..0af0be0d092 100644
--- a/string.c
+++ b/string.c
@@ -105,7 +105,8 @@ str_assign(str, str2)
VALUE str, str2;
{
if (NIL_P(str2) || str == str2) return;
- free(RSTRING(str)->ptr);
+ if (!RSTRING(str)->orig && RSTRING(str)->ptr)
+ free(RSTRING(str)->ptr);
RSTRING(str)->ptr = RSTRING(str2)->ptr;
RSTRING(str)->len = RSTRING(str2)->len;
RSTRING(str)->orig = RSTRING(str2)->orig;