summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1997-02-27 01:53:51 -0500
committerChip Salzenberg <chip@atlantic.net>1997-02-25 13:12:02 +1200
commit1da885048b65b5be1bd3077c6fc45f92c567e1b5 (patch)
tree33b20d8b1a82876e19ca2753ea37a1689f7a7292
parenta61fe43df197fcc70e6f310c06ee17d52b606c45 (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 62a01ec5ae..0e924a35ce 100644
--- a/pp.c
+++ b/pp.c
@@ -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);