summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-09-12 22:09:51 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-09-12 22:09:51 +0000
commite763e3dc1f6aaacf9b75417484c98496493059ec (patch)
tree0340368818c108e8891f0e733ad387fe2fb44eb4 /sv.c
parente77e2f143f073d08d6764e30771960b2bccde0db (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 20f344f388..3a443a247f 100644
--- a/sv.c
+++ b/sv.c
@@ -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();