This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix leak GH #18054
authorKarl Williamson <khw@cpan.org>
Wed, 12 Aug 2020 23:53:52 +0000 (17:53 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 12 Aug 2020 23:57:55 +0000 (17:57 -0600)
This was a simple matter of one path failing to free the memory.

regcomp.c

index addf375..01f297c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -15191,6 +15191,8 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
                                 FAIL2("panic: loc_correspondence[%d] is 0",
                                       (int) (s - s_start));
                             }
+                            Safefree(locfold_buf);
+                            Safefree(loc_correspondence);
                         }
                         else {
                             upper_fill = s - s0;