summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 900f900f16..cc307866db 100644
--- a/string.c
+++ b/string.c
@@ -1465,6 +1465,7 @@ rb_str_modify_expand(VALUE str, long expand)
int termlen = TERM_LEN(str);
if (!STR_EMBED_P(str)) {
REALLOC_N(RSTRING(str)->as.heap.ptr, char, capa + termlen);
+ STR_UNSET_NOCAPA(str);
RSTRING(str)->as.heap.aux.capa = capa;
}
else if (capa + termlen > RSTRING_EMBED_LEN_MAX + 1) {