From: Dave Mitchell Date: Sun, 12 Sep 2004 22:09:51 +0000 (+0000) Subject: [perl #30066] Memory leak in nested shared data structures in 5.8.4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e763e3dc1f6aaacf9b75417484c98496493059ec;p=p5sagit%2Fp5-mst-13.2.git [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 --- diff --git a/sv.c b/sv.c index 20f344f..3a443a2 100644 --- a/sv.c +++ b/sv.c @@ -1756,6 +1756,7 @@ You generally want to use the C macro wrapper. See also C. 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();