From: Ilya Zakharevich Date: Thu, 27 Feb 1997 06:53:51 +0000 (-0500) Subject: pp_undef was not always freeing memory X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1da885048b65b5be1bd3077c6fc45f92c567e1b5;p=p5sagit%2Fp5-mst-13.2.git 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> --- diff --git a/pp.c b/pp.c index 62a01ec..0e924a3 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);