summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-09-02 15:35:36 +1000
committerTony Cook <tony@develop-help.com>2019-09-02 15:35:36 +1000
commit05a03c0da6f3694904885fa1629a6e35e75d2875 (patch)
tree167beb37f816c7f25daca2a515386d4f0e98918c /regexec.c
parente99ccafab27dc0d084a8c16ed5a07fe8f4cc87ce (diff)
downloadperl-05a03c0da6f3694904885fa1629a6e35e75d2875.tar.gz
(perl #134390) don't leak the SV we just created on an early return
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index c390bff72e..97ea458a20 100644
--- a/regexec.c
+++ b/regexec.c
@@ -10405,6 +10405,7 @@ S_to_byte_substr(pTHX_ regexp *prog)
&& !prog->substrs->data[i].substr) {
SV* sv = newSVsv(prog->substrs->data[i].utf8_substr);
if (! sv_utf8_downgrade(sv, TRUE)) {
+ SvREFCNT_dec_NN(sv);
return FALSE;
}
if (SvVALID(prog->substrs->data[i].utf8_substr)) {