From: Jarkko Hietaniemi Date: Sat, 8 Apr 2006 18:52:32 +0000 (+0300) Subject: pp_sys.c: some Coverity findings: NULL guards for io pointers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ee74a8413ea165905e4d6df1d5c311295897dfc;p=p5sagit%2Fp5-mst-13.2.git pp_sys.c: some Coverity findings: NULL guards for io pointers Message-Id: <20060408155232.4C9726D08C@ugli.hut.fi> Date: Sat, 8 Apr 2006 18:52:32 +0300 (EEST) p4raw-id: //depot/perl@27755 --- diff --git a/pp_sys.c b/pp_sys.c index 7a3dbc7..1db57b0 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2276,7 +2276,7 @@ PP(pp_socket) if (!gv || !io) { if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - if (IoIFP(io)) + if (io && IoIFP(io)) do_close(gv, FALSE); SETERRNO(EBADF,LIB_INVARG); RETPUSHUNDEF; @@ -2332,9 +2332,9 @@ PP(pp_sockpair) if (!gv2 || !io2) report_evil_fh(gv1, io2, PL_op->op_type); } - if (IoIFP(io1)) + if (io1 && IoIFP(io1)) do_close(gv1, FALSE); - if (IoIFP(io2)) + if (io2 && IoIFP(io2)) do_close(gv2, FALSE); RETPUSHUNDEF; }