This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #56908] DBI memory leak in 5.10.0 due to change 26530
authorDave Mitchell <davem@fdisolutions.com>
Wed, 20 Aug 2008 23:15:36 +0000 (23:15 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Wed, 20 Aug 2008 23:15:36 +0000 (23:15 +0000)
commitb17f5ab768c4daa8faac6c85c0c20d3895f406e1
tree2075faf38f83ac6d5dd27e4d078117ff91d7956d
parent7ee5fac837a8a4ebf1956da1b1d252aa82fe506d
[perl #56908] DBI memory leak in 5.10.0 due to change 26530

A weakref to a HV would leak, because the xhv_backreferences
array is created with a refcount of 2 (to avoid premature freeing
during global destruction), but the RC was only decremented once
when the parent HV was freed.
Also, when thread cloned, the new array was being created with a
RC of 1, rather than 2, which coincidentally worked due to the
first bug.

p4raw-id: //depot/perl@34209
hv.c
sv.c