diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-09-12 22:09:51 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-09-12 22:09:51 +0000 |
commit | e763e3dc1f6aaacf9b75417484c98496493059ec (patch) | |
tree | 0340368818c108e8891f0e733ad387fe2fb44eb4 /sv.c | |
parent | e77e2f143f073d08d6764e30771960b2bccde0db (diff) | |
download | perl-e763e3dc1f6aaacf9b75417484c98496493059ec.tar.gz |
[perl #30066] Memory leak in nested shared data structures in 5.8.4
A pop of an item from a shared array ref causes a leak due to
AVf_REAL not having been set after an sv_upgrade(sv, SVt_PVAV).
Make sv_upgrade() set always this flag.
p4raw-id: //depot/perl@23320
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1756,6 +1756,7 @@ You generally want to use the C<SvUPGRADE> macro wrapper. See also C<svtype>. bool Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) { + char* pv = NULL; U32 cur = 0; U32 len = 0; @@ -1953,7 +1954,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) SvSTASH(sv) = stash; AvALLOC(sv) = 0; AvARYLEN(sv) = 0; - AvFLAGS(sv) = 0; + AvFLAGS(sv) = AVf_REAL; break; case SVt_PVHV: SvANY(sv) = new_XPVHV(); |