From fad5b8a021c1cf9c9185bbbc1d16f54aaf867fff Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 26 May 2013 15:59:53 +0200 Subject: [PATCH] Remove fw3_ubus_address_free() and use fw3_free_list() instead --- options.c | 2 +- redirects.c | 4 ++-- ubus.c | 14 -------------- ubus.h | 1 - 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/options.c b/options.c index a2a0465..c5cfc9e 100644 --- a/options.c +++ b/options.c @@ -347,7 +347,7 @@ fw3_parse_network(void *ptr, const char *val, bool is_list) break; } - fw3_ubus_address_free(addr_list); + fw3_free_list(addr_list); } } diff --git a/redirects.c b/redirects.c index d1aa0f0..789f7b3 100644 --- a/redirects.c +++ b/redirects.c @@ -554,10 +554,10 @@ expand_redirect(struct fw3_ipt_handle *handle, struct fw3_state *state, &ref_addr, int_addr, ext_addr); } - fw3_ubus_address_free(int_addrs); + fw3_free_list(int_addrs); } - fw3_ubus_address_free(ext_addrs); + fw3_free_list(ext_addrs); } } diff --git a/ubus.c b/ubus.c index 16c8c49..d5f52b9 100644 --- a/ubus.c +++ b/ubus.c @@ -182,17 +182,3 @@ fw3_ubus_address(const char *net) { return invoke_common(net, false); } - -void -fw3_ubus_address_free(struct list_head *list) -{ - struct fw3_address *addr, *tmp; - - list_for_each_entry_safe(addr, tmp, list, list) - { - list_del(&addr->list); - free(addr); - } - - free(list); -} diff --git a/ubus.h b/ubus.h index 0b4c01a..e16b873 100644 --- a/ubus.h +++ b/ubus.h @@ -31,6 +31,5 @@ void fw3_ubus_disconnect(void); struct fw3_device * fw3_ubus_device(const char *net); struct list_head * fw3_ubus_address(const char *net); -void fw3_ubus_address_free(struct list_head *list); #endif -- 2.25.1