aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_host.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-06 11:58:06 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-06 11:58:06 +0100
commit87c79f99b6b2ce6895116c3bf9e5a8d28ff5b322 (patch)
tree64dd662fc613acfe2bee021b4f0565aacff78d35 /pingu_host.c
parentc73cf48ae4ec3589b07e4b6a39ada2a2bb67de08 (diff)
downloadpingu-87c79f99b6b2ce6895116c3bf9e5a8d28ff5b322.tar.bz2
pingu-87c79f99b6b2ce6895116c3bf9e5a8d28ff5b322.tar.xz
pingu: cleanup various structures on shutdown
Diffstat (limited to 'pingu_host.c')
-rw-r--r--pingu_host.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pingu_host.c b/pingu_host.c
index 81719a6..be44343 100644
--- a/pingu_host.c
+++ b/pingu_host.c
@@ -139,3 +139,19 @@ int pingu_host_init(struct ev_loop *loop)
return 0;
}
+void pingu_host_cleanup(void)
+{
+ struct pingu_host *host, *n;
+ list_for_each_entry_safe(host, n, &host_list, host_list_entry) {
+ if (host->host != NULL)
+ free(host->host);
+ if (host->label != NULL)
+ free(host->label);
+ if (host->up_action != NULL)
+ free((void *)host->up_action);
+ if (host->down_action != NULL)
+ free((void *)host->down_action);
+ list_del(&host->host_list_entry);
+ free(host);
+ }
+}