diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | encoding.c | 1 |
2 files changed, 5 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Wed Jan 16 22:45:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * encoding.c (enc_register_at): make own copy. [ruby-dev:33136] + Wed Jan 16 18:03:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (pipe_open, rb_io_s_popen): clear temporary object to release 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; |