File descriptor leak in do_exec3
Ilya Zakharevich [Fri, 9 Jul 1999 04:27:51 +0000 (00:27 -0400)]
Message-Id: <199907090827.EAA03321@monk.mps.ohio-state.edu>

p4raw-id: //depot/perl@3678

util.c

diff --git a/util.c b/util.c
index 1ed48d2..f4857cf 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2304,10 +2304,11 @@ Perl_my_popen(pTHX_ char *cmd, char *mode)
                break;
            n += n1;
        }
+       PerlLIO_close(pp[0]);
+       did_pipes = 0;
        if (n) {                        /* Error */
            if (n != sizeof(int))
                Perl_croak(aTHX_ "panic: kid popen errno read");
-           PerlLIO_close(pp[0]);
            errno = errkid;             /* Propagate errno from kid */
            return Nullfp;
        }