From: Ulrich Drepper Date: Wed, 12 Apr 2000 20:47:33 +0000 (+0000) Subject: (_IO_old_proc_open): Close pipes in case the mode is invalid. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe46dd6e6d18898575096c09396714a6c2a04cf2;p=thirdparty%2Fglibc.git (_IO_old_proc_open): Close pipes in case the mode is invalid. --- diff --git a/libio/oldiopopen.c b/libio/oldiopopen.c index 556a9ff86f4..63d8f82591b 100644 --- a/libio/oldiopopen.c +++ b/libio/oldiopopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU IO Library. Written by Per Bothner . @@ -133,6 +133,8 @@ _IO_old_proc_open (fp, command, mode) } else { + _IO_close (pipe_fds[0]); + _IO_close (pipe_fds[1]); __set_errno (EINVAL); return NULL; } @@ -141,7 +143,7 @@ _IO_old_proc_open (fp, command, mode) { int child_std_end = mode[0] == 'r' ? 1 : 0; struct _IO_proc_file *p; - + _IO_close (parent_end); if (child_end != child_std_end) {