This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #112358] Storable: Don’t create RV with no refcnt
Otherwise assigning to it will cause the referent to be freed, because
nothing but Storable knows that it has no reference count.
Storable.xs was creating a new RV without increasing the refe-
rence count on the referent. It was then using it to call the
STORABLE_freeze method on the object. Since Perl passes arguments
by reference, it was possible to unref the reference by assigning to
$_[0] within STORABLE_freeze. That would cause the object’s reference
count to go down.