This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #107000] Don’t leak if hh copying dies
authorFather Chrysostomos <sprout@cpan.org>
Sun, 23 Sep 2012 19:42:15 +0000 (12:42 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 24 Sep 2012 01:29:33 +0000 (18:29 -0700)
commit0db511c03fa45894d146905ba3408b3be3f5baa0
tree837511055c3fc3642b425a28d566267fd20f9211
parent518618af9da07b079c1585df2b7c76a1aed0f19c
[perl #107000] Don’t leak if hh copying dies

When %^H is copied on entering a new scope, if it happens to have been
tied it can die.  This was resulting in leaks, because no protections
were added to handle that case.

The two things that were leaking were the new hash in hv_copy_hints_hv
and the new value (for an element) in newSVsv.

By fixing newSVsv itself, this also fixes any potential leaks when
other pieces of code call newSVsv on explosive values.
hv.c
sv.c
t/op/svleak.t