summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/IO/IO.pm2
-rw-r--r--ext/IO/IO.xs5
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/IO/IO.pm b/ext/IO/IO.pm
index c8d06bdce2..ac0664258e 100644
--- a/ext/IO/IO.pm
+++ b/ext/IO/IO.pm
@@ -7,7 +7,7 @@ use Carp;
use strict;
use warnings;
-our $VERSION = "1.23";
+our $VERSION = "1.23_01";
XSLoader::load 'IO', $VERSION;
sub import {
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs
index 4abc135b35..4b896a5649 100644
--- a/ext/IO/IO.xs
+++ b/ext/IO/IO.xs
@@ -215,8 +215,9 @@ new_tmpfile(packname = "IO::File")
fp = tmpfile();
#endif
gv = (GV*)SvREFCNT_inc(newGVgen(packname));
- hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
- if (do_open(gv, "+>&", 3, FALSE, 0, 0, fp)) {
+ if (gv)
+ hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
+ if (gv && do_open(gv, "+>&", 3, FALSE, 0, 0, fp)) {
ST(0) = sv_2mortal(newRV((SV*)gv));
sv_bless(ST(0), gv_stashpv(packname, TRUE));
SvREFCNT_dec(gv); /* undo increment in newRV() */