This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The scratch scalar used in -d processing for : and = options would leak
authorNicholas Clark <nick@ccl4.org>
Sat, 6 Oct 2007 16:32:36 +0000 (16:32 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 6 Oct 2007 16:32:36 +0000 (16:32 +0000)
as it was never freed.

p4raw-id: //depot/perl@32052

perl.c

diff --git a/perl.c b/perl.c
index b8096c2..3371b84 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3041,6 +3041,7 @@ Perl_moreswitches(pTHX_ char *s)
            }
            s += strlen(s);
            my_setenv("PERL5DB", SvPV_nolen_const(sv));
            }
            s += strlen(s);
            my_setenv("PERL5DB", SvPV_nolen_const(sv));
+           SvREFCNT_dec(sv);
        }
        if (!PL_perldb) {
            PL_perldb = PERLDB_ALL;
        }
        if (!PL_perldb) {
            PL_perldb = PERLDB_ALL;