This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Fix potential scalar leak
The lines in this code were reversed. We need to check something before
overwriting it, rather than the other way around. The result would be
that under certain circumstances a SV would not get freed. Those
circumstances are very limited: the first of the three parameters to
this function is not empty, but the 2nd is, and the output (3rd
parameter) is to overwrite the 2nd. I found this bug by code reading; I
have searched the code space and there are no current calls to it that
have this parameter configuration, therefore there is no test that can
be added to trigger it.