summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index b935734e4c..0a086a8b4f 100644
--- a/perlio.c
+++ b/perlio.c
@@ -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;
}