starter: Close open file descriptors when forking daemons.
[strongswan.git] / src / starter / invokecharon.c
index e889394..ead55e9 100644 (file)
@@ -192,6 +192,7 @@ int starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb)
                case 0:
                        /* child */
                        setsid();
+                       closefrom(3);
                        sigprocmask(SIG_SETMASK, 0, NULL);
                        /* disable glibc's malloc checker, conflicts with leak detective */
                        setenv("MALLOC_CHECK_", "0", 1);