diff options
author | Chris Heath <chris@heathens.co.nz> | 2005-11-06 12:08:05 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-11-07 09:58:26 +0000 |
commit | 21401c75f1c38e127fa870b81fca15879c466865 (patch) | |
tree | 05dc6a5bf0c21b4a1d11b33cc06625f47aae2b2f /cop.h | |
parent | 03e3cfa350ab0751663457000c3c7743ae7d5de1 (diff) | |
download | perl-21401c75f1c38e127fa870b81fca15879c466865.tar.gz |
[perl #24254] Attempt to free unreferenced scalar
From: "Chris Heath via RT" <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-24254-123984.4.44134155985068@perl.org>
p4raw-id: //depot/perl@26027
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -407,9 +407,14 @@ struct block_loop { #define POPLOOP(cx) \ SvREFCNT_dec(cx->blk_loop.iterlval); \ if (CxITERVAR(cx)) { \ - SV **s_v_p = CxITERVAR(cx); \ - sv_2mortal(*s_v_p); \ - *s_v_p = cx->blk_loop.itersave; \ + if (SvPADMY(cx->blk_loop.itersave)) { \ + SV **s_v_p = CxITERVAR(cx); \ + sv_2mortal(*s_v_p); \ + *s_v_p = cx->blk_loop.itersave; \ + } \ + else { \ + SvREFCNT_dec(cx->blk_loop.itersave); \ + } \ } \ if (cx->blk_loop.iterary && cx->blk_loop.iterary != PL_curstack)\ SvREFCNT_dec(cx->blk_loop.iterary); |