Prevent memory leak when string literal is created.

This commit is contained in:
Masamitsu MURASE
2012-06-26 01:34:41 +09:00
parent c99b806f8b
commit c152c194a1
+1 -1
View File
@@ -292,7 +292,7 @@ mrb_str_literal(mrb_state *mrb, mrb_value str)
struct RString *s, *orig;
struct mrb_shared_string *shared;
s = str_new(mrb, 0, 0);
s = str_alloc(mrb, mrb->string_class);
orig = mrb_str_ptr(str);
if (!(orig->flags & MRB_STR_SHARED)) {
str_make_shared(mrb, mrb_str_ptr(str));