diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-26 15:58:17 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-26 16:09:01 +0200 |
commit | b59c49627595da73b4f6ea8a88829d97f4f76c84 (patch) | |
tree | cbb4074d02da6275dd97736a587685b5d952ab17 /utils.c | |
parent | 1a431c11cec3a786efbed6f559a5048201c2b5db (diff) | |
download | firewall3-b59c49627595da73b4f6ea8a88829d97f4f76c84.tar.gz |
Add fw3_free_list() helper
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -656,6 +656,22 @@ fw3_free_object(void *obj, const void *opts) free(obj); } +void +fw3_free_list(struct list_head *head) +{ + struct list_head *entry, *tmp; + + if (!head) + return; + + list_for_each_safe(entry, tmp, head) + { + list_del(entry); + free(entry); + } + + free(head); +} bool fw3_hotplug(bool add, void *zone, void *device) |