This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Stop SAVEFREEOP from leaking slabs
authorFather Chrysostomos <sprout@cpan.org>
Mon, 5 Nov 2012 01:44:06 +0000 (17:44 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 5 Nov 2012 06:45:35 +0000 (22:45 -0800)
commitee5ee8539c7146494698baa407f2b0ee47da8439
tree0737a751ebff8378faa8f8ec545335333e194447
parent600beb2e6249f5c5f73430f8c8da2a6c90891616
op.c: Stop SAVEFREEOP from leaking slabs

When a CV is freed prematurely, it cleans up its op slab.  But
SAVEFREEOP may cause the savestack to point to an op in that slab
after the CV has been freed, so SAVEFREEOP is allowed to coun-
termand the freeing of the slab.  Every op that is not on the
savestack is freed.

The reference count of the slab was being left off by one.  The result
was that when the stack unwinding freed the op, it would leave the
slab behind and leak it.
op.c