diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2022-09-09 21:44:29 +0000 |
---|---|---|
committer | Richard Leach <richardleach@users.noreply.github.com> | 2022-09-18 23:50:26 +0100 |
commit | 51918aaf0287a9f5643ea3161fd8c6091a127428 (patch) | |
tree | 91e7f021d635b70a9cfd78f8083050b0580deb73 /regcomp.c | |
parent | 8af03a11d8197fbbc9700846c4aa5c1baa32b281 (diff) | |
download | perl-51918aaf0287a9f5643ea3161fd8c6091a127428.tar.gz |
S_regclass - use SvPVCLEAR_FRESH on new SV
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -18444,8 +18444,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, * points. */ AV * this_string = (AV *) av_shift( strings); STRLEN cp_count = av_count(this_string); - SV * final = newSV(cp_count * 4); - SvPVCLEAR(final); + SV * final = newSV(cp_count ? cp_count * 4 : 1); + SvPVCLEAR_FRESH(final); /* Create another string of sequences of \x{...} */ while (av_count(this_string) > 0) { |