need to initialize flags for pooled strings; close #1768

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-01 10:48:22 +09:00
parent 5fb8fa5a81
commit 78f2902c06
+1
View File
@@ -176,6 +176,7 @@ mrb_str_pool(mrb_state *mrb, mrb_value str)
ns->flags = MRB_STR_NOFREE;
}
else {
ns->flags = 0;
ns->ptr = (char *)mrb_malloc(mrb, (size_t)len+1);
if (s->ptr) {
memcpy(ns->ptr, s->ptr, len);