diff options
author | Karl Williamson <khw@cpan.org> | 2018-10-19 11:49:01 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-10-20 00:09:56 -0600 |
commit | deeb899527fafbf46c2ae732d30fbaedd79d1b84 (patch) | |
tree | 76a701a2e3f6aa2a34bf458df28ef1e34d0a3284 | |
parent | 4c8117d3827c12973c9516055b2dcef5138533b1 (diff) | |
download | perl-deeb899527fafbf46c2ae732d30fbaedd79d1b84.tar.gz |
regcomp.c: Avoid potential NULL ptr dereference
This commit cause the passed in variable to be non-NULL before
dereferencing it, as defensive coding practice. A future commit causes
this to matter.
-rw-r--r-- | regcomp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -20277,6 +20277,9 @@ Perl_pregfree2(pTHX_ REGEXP *rx) PERL_ARGS_ASSERT_PREGFREE2; + if (! r) + return; + if (r->mother_re) { ReREFCNT_dec(r->mother_re); } else { @@ -20422,6 +20425,10 @@ Perl_regfree_internal(pTHX_ REGEXP * const rx) PERL_ARGS_ASSERT_REGFREE_INTERNAL; + if (! ri) { + return; + } + DEBUG_COMPILE_r({ if (!PL_colorset) reginitcolors(); |