diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-15 20:55:20 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-15 20:55:20 +0000 |
commit | 71cd1c3f4e2173121a6276de584bf61b847fd780 (patch) | |
tree | 87aa2abf296b61c12bc72b0d62e4933e0fc6490c /ext/IO | |
parent | 578e3dbccd1bcbfde2fd9bf4c78cf0432beb8492 (diff) | |
download | perl-71cd1c3f4e2173121a6276de584bf61b847fd780.tar.gz |
Coverity correctly reports that gv might (just) be NULL. So don't
derefernece it if it is.
p4raw-id: //depot/perl@27823
Diffstat (limited to 'ext/IO')
-rw-r--r-- | ext/IO/IO.pm | 2 | ||||
-rw-r--r-- | ext/IO/IO.xs | 5 |
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() */ |