Remove fw3_ubus_address_free() and use fw3_free_list() instead
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 26 May 2013 13:59:53 +0000 (15:59 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 26 May 2013 14:09:06 +0000 (16:09 +0200)
options.c
redirects.c
ubus.c
ubus.h

index a2a0465d8bab1ab8e2a4eed9f6546d00182d3afc..c5cfc9e83e82d00cda298a632a30cb91e3bab55f 100644 (file)
--- 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);
                }
        }
 
index d1aa0f049f9bfa1773ff1634ef6c1953764e7d31..789f7b30aabf31797536996595c49697b60bffe8 100644 (file)
@@ -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 16c8c49c66713a857bc19ea665c8eddca4a6f1ad..d5f52b9287f4ac71b049e675c91805b42d9d5da7 100644 (file)
--- 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 0b4c01a1771815953c90242d95ab2dbd68cfda63..e16b873f7a6cb1155f904f55a17c8515f954830a 100644 (file)
--- 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