summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-01-19 16:43:54 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-01-22 12:47:03 +0000
commit6b42d12b8135b62734b087ee4b02cf28d259a483 (patch)
treef4c8219179645773872ef0bf1a6abb0dcec3625f /av.c
parente05a8f29fa78aef20a9869bf742d9b3217cda019 (diff)
downloadperl-6b42d12b8135b62734b087ee4b02cf28d259a483.tar.gz
Re: [perl #15439] unreferenced scalar due to double DESTROY
Message-ID: <20030119164353.B24444@fdgroup.com> p4raw-id: //depot/perl@18554
Diffstat (limited to 'av.c')
-rw-r--r--av.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/av.c b/av.c
index acc9963eec..10cc2fef99 100644
--- a/av.c
+++ b/av.c
@@ -453,8 +453,11 @@ Perl_av_clear(pTHX_ register AV *av)
ary = AvARRAY(av);
key = AvFILLp(av) + 1;
while (key) {
- SvREFCNT_dec(ary[--key]);
+ SV * sv = ary[--key];
+ /* undef the slot before freeing the value, because a
+ * destructor might try to modify this arrray */
ary[key] = &PL_sv_undef;
+ SvREFCNT_dec(sv);
}
}
if ((key = AvARRAY(av) - AvALLOC(av))) {