From 372d7ff8241888bc3895182b39497fa23381b7e7 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Tue, 15 Sep 2020 22:32:25 +0100 Subject: shutdown: free children from right place --- src/child.c | 4 ++++ src/child.h | 1 + src/main.c | 1 + 3 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/child.c b/src/child.c index 9d59d20..3b1800f 100644 --- a/src/child.c +++ b/src/child.c @@ -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 diff --git a/src/child.h b/src/child.h index 70f52b7..efc6fe3 100644 --- a/src/child.h +++ b/src/child.h @@ -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); diff --git a/src/main.c b/src/main.c index 0f445f6..2d695ed 100644 --- a/src/main.c +++ b/src/main.c @@ -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) { -- cgit v1.2.3