From: Adrian M. Enache Date: Sun, 26 Jan 2003 04:55:48 +0000 (+0200) Subject: Re: [perl #20408] SV's SvPVX get freed even when its SvLEN is zero X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a732c88957a4ca9f9d2b586ea3b6b8e9b04f8ace;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #20408] SV's SvPVX get freed even when its SvLEN is zero Message-Id: <20030126025548.GB812@ratsnest.hole> p4raw-id: //depot/perl@18579 --- diff --git a/pp_ctl.c b/pp_ctl.c index ed392cc..1a3fd1d 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -182,7 +182,8 @@ PP(pp_substcont) cx->sb_rxtainted |= RX_MATCH_TAINTED(rx); (void)SvOOK_off(targ); - Safefree(SvPVX(targ)); + if (SvLEN(targ)) + Safefree(SvPVX(targ)); SvPVX(targ) = SvPVX(dstr); SvCUR_set(targ, SvCUR(dstr)); SvLEN_set(targ, SvLEN(dstr));