This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid leak with local $h{foo}, $a[n]
When SAVEt_DELETE / SAVEt_ADELETE deletes a hash/array entry on scope
exit, they also decrement the refcount of the hash/array, and for the
hash, also free the saved key.
However, if the call to hv_delete() or av_delete() dies (e.g. when
calling a tied DELETE method) then the hash/array and key will leak
because leave_scope() calls av/hv_delete(), *then* does the
SvREFCNT_dec() etc.
The fix is to push new FREEPV/FREESV actions just before calling
av/hv_delete().