From 5efa8937ed569dcd925c4c55f591f4d1a50c6316 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sun, 30 Nov 2008 16:54:57 +0100 Subject: Free stacks when exiting. This patch modifies ulogd2 to have it free the stacks when leaving. --- src/ulogd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ulogd.c') diff --git a/src/ulogd.c b/src/ulogd.c index b079fd2..1a1f6af 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -994,6 +994,16 @@ static void unload_plugins() } } +static void stop_stack() +{ + struct ulogd_pluginstance_stack *stack, *nstack; + + llist_for_each_entry_safe(stack, nstack, &ulogd_pi_stacks, stack_list) { + free(stack); + } +} + + static void sigterm_handler(int signal) { @@ -1003,6 +1013,8 @@ static void sigterm_handler(int signal) stop_pluginstances(); + stop_stack(); + unload_plugins(); if (logfile != NULL && logfile != stdout) { -- cgit v1.2.3