Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 2003d1abfa0c20ee77815f0da33e2c1c > files > 59

glibc-2.5-49.el5_5.5.src.rpm

2007-07-20  Jakub Jelinek  <jakub@redhat.com>

	[BZ #4813]
	* login/forkpty.c (forkpty): Close master and slave fds on
	fork failure.  Patch by
	Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>.

--- libc/login/forkpty.c	6 Jul 2001 04:55:34 -0000	1.2
+++ libc/login/forkpty.c	20 Jul 2007 07:20:07 -0000	1.3
@@ -38,6 +38,8 @@ forkpty (amaster, name, termp, winp)
   switch (pid = fork ())
     {
     case -1:
+      close (master);
+      close (slave);
       return -1;
     case 0:
       /* Child.  */