diff options
author | Steve Peters <steve@fisharerojo.org> | 2009-02-23 13:25:33 -0600 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2009-02-23 13:25:33 -0600 |
commit | 40596bc538f0e2be42b50d80f46887e76a4a3b33 (patch) | |
tree | 20387daaf96e70c27384538662ae7a0be4df8628 /perlio.c | |
parent | 86bddcbfaf2555223ec8fc596416d13d7a1a1118 (diff) | |
download | perl-40596bc538f0e2be42b50d80f46887e76a4a3b33.tar.gz |
fileno() was failing when passed a NULL. I'm guessing that we don't really need to increase the refcount on a NULL fd.
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3033,7 +3033,9 @@ PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags) stdio = PerlSIO_fdopen(fd, PerlIO_modestr(o,mode)); set_this: PerlIOSelf(f, PerlIOStdio)->stdio = stdio; - PerlIOUnix_refcnt_inc(fileno(stdio)); + if(stdio) { + PerlIOUnix_refcnt_inc(fileno(stdio)); + } } return f; } |