diff options
author | Adrian M. Enache <enache@rdslink.ro> | 2003-01-20 01:54:07 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-01-20 17:43:15 +0000 |
commit | 2c28e92fc113ea28fd1822b2d63d3c1bfedbac8f (patch) | |
tree | d6f1f7030c53658956892a88fa5ee7e772d1233b /pp_hot.c | |
parent | 5fc90066d16fe0d0a69d1a8bcc8acbe64a4d8c74 (diff) | |
download | perl-2c28e92fc113ea28fd1822b2d63d3c1bfedbac8f.tar.gz |
[perl #20408] SV's SvPVX get freed even when its SvLEN is zero
From: "enache@rdslink.ro (via RT)" <perlbug-followup@perl.org>
Message-Id: <rt-20408-49009.18.2567818321236@bugs6.perl.org>
p4raw-id: //depot/perl@18522
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)); |