From: Rafael Garcia-Suarez Date: Fri, 22 Dec 2006 11:30:47 +0000 (+0000) Subject: Unshare the shared string gp_file_hek only if it exists in a GP. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9ce39a9108fcb88216bc67ce14c52154d53f364;p=p5sagit%2Fp5-mst-13.2.git Unshare the shared string gp_file_hek only if it exists in a GP. Not doing this will produce invalid frees in the global destruction process, probably because the empty string will get freed several times. This should be safe since gp_file_hek is only assigned a new value with share_hek(). p4raw-id: //depot/perl@29610 --- diff --git a/gv.c b/gv.c index 394e684..4878d80 100644 --- a/gv.c +++ b/gv.c @@ -1442,7 +1442,8 @@ Perl_gp_free(pTHX_ GV *gv) return; } - unshare_hek(gp->gp_file_hek); + if (gp->gp_file_hek) + unshare_hek(gp->gp_file_hek); SvREFCNT_dec(gp->gp_sv); SvREFCNT_dec(gp->gp_av); /* FIXME - another reference loop GV -> symtab -> GV ?