summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2002-04-18 01:56:16 +0000
committerDoug MacEachern <dougm@covalent.net>2002-04-18 01:56:16 +0000
commit9f375a433613c9bc1f6215ee2370484d82068b54 (patch)
treebacc3346e463eaf8cdf37af5854014a74cd58649 /perl.c
parent2d5a560e6257e98fbb384456cc2d9b09a6b228b7 (diff)
downloadperl-9f375a433613c9bc1f6215ee2370484d82068b54.tar.gz
plug memory leak in perl_destruct() by cleaning out PL_debug_pad
p4raw-id: //depot/perl@15988
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index 30db9e32bd..c32cc0a16e 100644
--- a/perl.c
+++ b/perl.c
@@ -820,6 +820,16 @@ perl_destruct(pTHXx)
SvREFCNT(&PL_sv_undef) = 0;
SvREADONLY_off(&PL_sv_undef);
+ {
+ int i;
+ for (i=0; i<=2; i++) {
+ SvREFCNT(PERL_DEBUG_PAD(i)) = 0;
+ sv_clear(PERL_DEBUG_PAD(i));
+ SvANY(PERL_DEBUG_PAD(i)) = NULL;
+ SvFLAGS(PERL_DEBUG_PAD(i)) = 0;
+ }
+ }
+
if (PL_sv_count != 0 && ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ packWARN(WARN_INTERNAL),"Scalars leaked: %ld\n", (long)PL_sv_count);