change#3373 introduced a handle leak in backticks and piped open()s
Gurusamy Sarathy [Sun, 25 Nov 2001 16:37:29 +0000 (16:37 +0000)]
that fail

p4raw-link: @3373 on //depot/perl: e446cec8f170ecc3eabea80092ef64589855e167

p4raw-id: //depot/perl@13260

util.c

diff --git a/util.c b/util.c
index 01238b8..de84200 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1957,6 +1957,7 @@ Perl_my_popen_list(pTHX_ char *mode, int n, SV **args)
        did_pipes = 0;
        if (n) {                        /* Error */
            int pid2, status;
+           PerlLIO_close(p[This]);
            if (n != sizeof(int))
                Perl_croak(aTHX_ "panic: kid popen errno read");
            do {
@@ -2099,6 +2100,7 @@ Perl_my_popen(pTHX_ char *cmd, char *mode)
        did_pipes = 0;
        if (n) {                        /* Error */
            int pid2, status;
+           PerlLIO_close(p[This]);
            if (n != sizeof(int))
                Perl_croak(aTHX_ "panic: kid popen errno read");
            do {