should initialize shared->buf as well as s->buf

This commit is contained in:
Yukihiro Matsumoto
2012-06-03 09:09:40 +09:00
parent 52fdeb0225
commit 6c2c5540e2
+1 -1
View File
@@ -265,7 +265,7 @@ str_make_shared(mrb_state *mrb, mrb_value str)
shared->refcnt = 1;
if (s->aux.capa > s->len) {
shared->buf = mrb_realloc(mrb, shared->buf, s->len+1);
s->buf = shared->buf = mrb_realloc(mrb, s->buf, s->len+1);
}
else {
shared->buf = s->buf;