From fe46dd6e6d18898575096c09396714a6c2a04cf2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 12 Apr 2000 20:47:33 +0000 Subject: (_IO_old_proc_open): Close pipes in case the mode is invalid. --- libio/oldiopopen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libio/oldiopopen.c b/libio/oldiopopen.c index 556a9ff86f..63d8f82591 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) { -- cgit 1.4.1