summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-12 20:47:08 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-12 20:47:08 +0000
commitc4693424e2de38eb6f286d2f1b146b67adb010f0 (patch)
tree1765a75d859631ff3f6879d6eb8f079d3bde8007
parent7c3c5620b4e3b21bd895ae5c9c4d3b6720e1423e (diff)
downloadglibc-c4693424e2de38eb6f286d2f1b146b67adb010f0.tar.gz
(_IO_new_proc_open): Close pipes in case the mode is invalid.
-rw-r--r--libio/iopopen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/iopopen.c b/libio/iopopen.c
index 6b2d7f5328..cc99ba934d 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -132,6 +132,8 @@ _IO_new_proc_open (fp, command, mode)
}
else
{
+ _IO_close (pipe_fds[0]);
+ _IO_close (pipe_fds[1]);
__set_errno (EINVAL);
return NULL;
}