mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Prevent memory leak when string literal is created.
This commit is contained in:
+1
-1
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user