This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
$ref++, $ref-- leaked referent
authorDavid Mitchell <davem@iabyn.com>
Mon, 6 Sep 2010 15:24:47 +0000 (16:24 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 6 Sep 2010 15:28:54 +0000 (16:28 +0100)
commit7dcb9b98df566764105b8c15283b393878a1788e
tree415bf0e3f04938b7e2470e2511cb6c027d810d74
parent44428a460de2170e69440fb654a61fe89892ba53
$ref++, $ref-- leaked referent

[perl #9466]

pp_postinc and pp_postdec used a pad TARG to return a copy of the
original value. When that value was a reference, it meant a copy
of the reference would hang out in the pad forever and so the referent
would leak. Fix this by using a mortal instead.
pp.c
t/op/inc.t