diff options
author | Ilya Zakharevich <ilya@math.ohio-state.edu> | 1997-02-27 01:53:51 -0500 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-02-25 13:12:02 +1200 |
commit | 1da885048b65b5be1bd3077c6fc45f92c567e1b5 (patch) | |
tree | 33b20d8b1a82876e19ca2753ea37a1689f7a7292 | |
parent | a61fe43df197fcc70e6f310c06ee17d52b606c45 (diff) | |
download | perl-1da885048b65b5be1bd3077c6fc45f92c567e1b5.tar.gz |
pp_undef was not always freeing memory
As I found, pp_undef in
$a = 'aaa';
$a = 0;
undef $a;
was not reclaiming the storage, as it does in
$a = 'aaa';
undef $a;
The patch is below fixes this shortcoming (tests ok, perl rebuilds
itself OK),
Enjoy,
p5p-msgid: <199702270707.CAA13978@monk.mps.ohio-state.edu>
private-msgid: <199702270653.BAA13949@monk.mps.ohio-state.edu>
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -555,7 +555,7 @@ PP(pp_undef) sv_setsv(sv, &sv_undef); break; default: - if (SvPOK(sv) && SvLEN(sv)) { + if (SvTYPE(sv) >= SVt_PV && SvPVX(sv) && SvLEN(sv)) { (void)SvOOK_off(sv); Safefree(SvPVX(sv)); SvPV_set(sv, Nullch); |