File descriptor leak in do_exec3
authorIlya Zakharevich <ilya@math.berkeley.edu>
Fri, 9 Jul 1999 04:27:51 +0000 (00:27 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 17 Jul 1999 17:54:01 +0000 (17:54 +0000)
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 1ed48d24369e63e2673ddcfa9fbb24e12bdd6631..f4857cf04fc92fbc5c912b034d1e759e09b78f31 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;
        }