diff options
author | David Mitchell <davem@iabyn.com> | 2019-11-12 15:34:55 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-11-12 15:34:55 +0000 |
commit | ecfd8588da8b6d2b74d6476d4d1c9e40c7de8b8c (patch) | |
tree | 07c2383d509bb5afd6e4c407a1b1523faff9dc47 | |
parent | f0206e819891ea9f375f3443e0a4d3ccf02acac8 (diff) | |
download | perl-ecfd8588da8b6d2b74d6476d4d1c9e40c7de8b8c.tar.gz |
remove leak in tr/ascii/utf8/
The recent change to use invlists left a bug in S_do_trans_invmap()
whereby it allocated a new temp buf if it knew the resulting string
would be too long, but failed to free the buffer at the end.
Showed up as smokes under ASAN failing these tests:
op/tr_latin1.t
op/tr.t
uni/tr_utf8.t
-rw-r--r-- | doop.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -523,6 +523,7 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap) s += s_len; if (! inplace) { sv_setpvn(sv, (char*)d0, d - d0); + Safefree(d0); } else { *d = '\0'; |