X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=utils.c;fp=utils.c;h=99310f731337879ee730f5a48a9c2c75522efdb4;hp=ea409742f829bd720dd043eff822a11235506c91;hb=b59c49627595da73b4f6ea8a88829d97f4f76c84;hpb=1a431c11cec3a786efbed6f559a5048201c2b5db diff --git a/utils.c b/utils.c index ea40974..99310f7 100644 --- a/utils.c +++ b/utils.c @@ -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)