[or-cvs] Fix an fd leak in start_daemon

Nick Mathewson nickm at seul.org
Thu Jun 30 06:56:02 UTC 2005


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]);
 }



More information about the tor-commits mailing list