diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2008-08-20 23:15:36 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2008-08-20 23:15:36 +0000 |
commit | b17f5ab768c4daa8faac6c85c0c20d3895f406e1 (patch) | |
tree | 2075faf38f83ac6d5dd27e4d078117ff91d7956d /hv.c | |
parent | 7ee5fac837a8a4ebf1956da1b1d252aa82fe506d (diff) | |
download | perl-b17f5ab768c4daa8faac6c85c0c20d3895f406e1.tar.gz |
[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
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1985,6 +1985,7 @@ Perl_hv_kill_backrefs(pTHX_ HV *hv) { if (av) { HvAUX(hv)->xhv_backreferences = 0; Perl_sv_kill_backrefs(aTHX_ (SV*) hv, av); + SvREFCNT_dec(av); } } |