This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #115440] Fix various leaks with fatal FETCH
authorFather Chrysostomos <sprout@cpan.org>
Thu, 25 Oct 2012 20:00:55 +0000 (13:00 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 26 Oct 2012 03:02:55 +0000 (20:02 -0700)
commit3ed356df9354193bbcc5202f066f3c07ae84b443
tree6a9fd54462d581f52672a517b461498fb798166e
parent33b889b0162a4f12e7c2a8d184afb63213130f07
[perl #115440] Fix various leaks with fatal FETCH

Various pieces of code were creating an SV and then assigning to it
from a value that might be magical.  If the source scalar is magical,
it could die when magic is called, leaking the scalar that would have
been assigned to.

So we call get-magic before creating the new scalar, and then use a
non-magical assignment.

Also, anonhash and anonlist were doing nothing to protect the aggre-
gate if an argument should die on FETCH, resulting in a leak.
av.c
ext/Devel-Peek/t/Peek.t
mathoms.c
pp.c
sv.c
t/op/svleak.t