diff options
author | Slaven Rezic <slaven@rezic.de> | 2002-07-31 11:50:06 +0200 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-08 14:44:21 +0000 |
commit | 89900bd3f9798cf0a5e524a809c7f1bb1b066fa2 (patch) | |
tree | 32c1341a179f9532236a67cdc96229b07569224e /pp.c | |
parent | 6b78add2c35f54b36819625ba31bac03f6bb28ea (diff) | |
download | perl-89900bd3f9798cf0a5e524a809c7f1bb1b066fa2.tar.gz |
Re: [perl #15523] Memory Leak in split with trailing empty elements
Message-id: <87ado85ob5.fsf@vran.herceg.de>
p4raw-id: //depot/perl@17696
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4611,8 +4611,12 @@ PP(pp_split) iters++; } else if (!origlimit) { - while (iters > 0 && (!TOPs || !SvANY(TOPs) || SvCUR(TOPs) == 0)) - iters--, SP--; + while (iters > 0 && (!TOPs || !SvANY(TOPs) || SvCUR(TOPs) == 0)) { + if (TOPs && !make_mortal) + sv_2mortal(TOPs); + iters--; + SP--; + } } if (realarray) { |