shutdown: free children from right place

This commit is contained in:
rofl0r 2020-09-15 22:32:25 +01:00
parent 2f3a3828ac
commit 372d7ff824
3 changed files with 6 additions and 0 deletions

View File

@ -245,6 +245,10 @@ void child_kill_children (int sig)
);
}
void child_free_children(void) {
sblist_free(childs);
childs = 0;
}
/**
* Listen on the various configured interfaces

View File

@ -36,6 +36,7 @@ extern int child_listening_sockets (vector_t listen_addrs, uint16_t port);
extern void child_close_sock (void);
extern void child_main_loop (void);
extern void child_kill_children (int sig);
extern void child_free_children(void);
extern short int child_configure (child_config_t type, unsigned int val);

View File

@ -401,6 +401,7 @@ main (int argc, char **argv)
child_kill_children (SIGTERM);
child_close_sock ();
child_free_children();
/* Remove the PID file */
if (config->pidpath != NULL && unlink (config->pidpath) < 0) {