summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 13:45:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 13:45:29 +0000
commitd969620ea8892b580cf7d14a0f3c26c4fea1275f (patch)
tree82d55c2dc20588c8728a2532021ba3d187049d7f /encoding.c
parent9c1bf098e0c7cc9c0d4761ca951d57c4a1766c40 (diff)
* encoding.c (enc_register_at): make own copy. [ruby-dev:33136]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/encoding.c b/encoding.c
index 4b121ac4e1..4fc8236662 100644
--- a/encoding.c
+++ b/encoding.c
@@ -146,6 +146,7 @@ enc_register_at(int index, const char *name, rb_encoding *encoding)
{
struct rb_encoding_entry *ent = &enc_table.list[index];
+ name = strdup(name);
ent->name = name;
if (!ent->enc) ent->enc = malloc(sizeof(rb_encoding));
*ent->enc = *encoding;