summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Leblond <eric@inl.fr>2008-11-30 16:54:57 +0100
committerEric Leblond <eric@inl.fr>2008-12-09 01:19:25 +0100
commit5efa8937ed569dcd925c4c55f591f4d1a50c6316 (patch)
treec101716352dbf0b66419ecfa73b8e2abfc97879f /src
parent1295f2228397f8d7566007d7e62f37e6169384d7 (diff)
Free stacks when exiting.
This patch modifies ulogd2 to have it free the stacks when leaving.
Diffstat (limited to 'src')
-rw-r--r--src/ulogd.c12
1 files changed, 12 insertions, 0 deletions
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) {