Clear MRB_STR_SHARED flag in mrb_str_modify_keep_ascii; close #4807

This commit is contained in:
KOBAYASHI Shuji
2019-11-07 22:16:59 +09:00
parent c10e191ac7
commit 45aa5081e4
+1
View File
@@ -820,6 +820,7 @@ mrb_str_modify_keep_ascii(mrb_state *mrb, struct RString *s)
if (shared->refcnt == 1 && s->as.heap.ptr == shared->ptr) {
s->as.heap.aux.capa = shared->capa;
s->as.heap.ptr[s->as.heap.len] = '\0';
RSTR_UNSET_SHARED_FLAG(s);
mrb_free(mrb, shared);
}
else {