PERL PERL5 CHANGES 33 CHANGE 23320 PERL 30066 MEMORY LEAK IN NESTED SHARED DATA STRUCTURES IN 5 8 4
Date: Sun, 12 Sep 2004 15:45:01 -0700

Subject: Change 23320: [perl #30066] Memory leak in nested shared data structures in 5.8.4
From: davem@no-spam (Dave Mitchell)

Change 23320 by davem@no-spam on 2004/09/12 22:09:51

[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.

Affected files ...

... //depot/perl/sv.c#762 edit
Differences ...

==== //depot/perl/sv.c#762 (text) ====
Index: perl/sv.c --- perl/sv.c#761~23277~ Wed Sep 8 09:49:59 2004
+++ perl/sv.c Sun Sep 12 15:09:51 2004
@@no-spam -1756,6 +1756,7 @@no-spam bool Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt)
{
+
char* pv = NULL;
U32 cur = 0;
U32 len = 0;
@@no-spam -1953,7 +1954,7 @@no-spam SvSTASH(sv) = stash;
AvALLOC(sv) = 0;
AvARYLEN(sv) = 0;
- AvFLAGS(sv) = 0;
+ AvFLAGS(sv) = AVf_REAL;
break;
case SVt_PVHV:
SvANY(sv) = new_XPVHV();
End of Patch.