From 2c28e92fc113ea28fd1822b2d63d3c1bfedbac8f Mon Sep 17 00:00:00 2001 From: "Adrian M. Enache" Date: Mon, 20 Jan 2003 01:54:07 +0000 Subject: [perl #20408] SV's SvPVX get freed even when its SvLEN is zero From: "enache@rdslink.ro (via RT)" Message-Id: p4raw-id: //depot/perl@18522 --- pp_hot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pp_hot.c') diff --git a/pp_hot.c b/pp_hot.c index 461c666ac9..1a40441ad8 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2129,7 +2129,8 @@ PP(pp_subst) sv_catpvn(dstr, s, strend - s); (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)); -- cgit v1.2.1