[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix an fd leak in start_daemon



Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv26346/src/common

Modified Files:
	util.c 
Log Message:
Fix an fd leak in start_daemon

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -d -r1.210 -r1.211
--- util.c	11 Jun 2005 05:31:15 -0000	1.210
+++ util.c	30 Jun 2005 06:56:00 -0000	1.211
@@ -1418,6 +1418,8 @@
     log_fn(LOG_ERR,"dup2 failed. Exiting.");
     exit(1);
   }
+  if (nullfd > 2)
+    close(nullfd);
   write(daemon_filedes[1], &c, sizeof(char)); /* signal success */
   close(daemon_filedes[1]);
 }