Bug #4956 » 0001-string.c-tr_s_bang-fix-leak-with-heap-strings.patch
| string.c | ||
|---|---|---|
|
CHECK_IF_ASCII(c);
|
||
|
t += tlen;
|
||
|
}
|
||
|
if (!STR_EMBED_P(str)) {
|
||
|
xfree(RSTRING(str)->as.heap.ptr);
|
||
|
}
|
||
|
*t = '\0';
|
||
|
RSTRING(str)->as.heap.ptr = buf;
|
||
|
RSTRING(str)->as.heap.len = t - buf;
|
||