summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-22 11:30:47 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-22 11:30:47 +0000
commitc9ce39a9108fcb88216bc67ce14c52154d53f364 (patch)
tree273de75bbe4424c0a86c60511a70acebfce65c00 /gv.c
parent0c793b6f00b278111ed6958bc7f2b834f3da392c (diff)
downloadperl-c9ce39a9108fcb88216bc67ce14c52154d53f364.tar.gz
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
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 394e684ad5..4878d80fb9 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 ?