From: Dave Mitchell Date: Thu, 29 Sep 2005 22:57:44 +0000 (+0000) Subject: PL_defoutgv could be used after being freed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0de6cf512b37d5b6155a1ac4adba112e3a4b766;p=p5sagit%2Fp5-mst-13.2.git PL_defoutgv could be used after being freed Was giving "use of freed value" warnings in t/io/through.t and t/io/crlf_through.t p4raw-id: //depot/perl@25665 --- diff --git a/perl.c b/perl.c index fc0972c..caa58d3 100644 --- a/perl.c +++ b/perl.c @@ -739,6 +739,8 @@ perl_destruct(pTHXx) */ sv_clean_objs(); PL_sv_objcount = 0; + if (PL_defoutgv && !SvREFCNT(PL_defoutgv)) + PL_defoutgv = Nullgv; /* may have been freed */ } /* unhook hooks which will soon be, or use, destroyed data */