X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=ipsets.c;h=f4253c7bab64b467a5ca59d0a2813678084029ce;hp=215be73605bbfe289d5840ec7df189ccabe5412b;hb=5b051a66fad3c208380d69b4b13d09929fcfe101;hpb=ea1e5c25c1c4c8c82b51c0440d033944ccb4e2e2 diff --git a/ipsets.c b/ipsets.c index 215be73..f4253c7 100644 --- a/ipsets.c +++ b/ipsets.c @@ -355,17 +355,20 @@ fw3_destroy_ipsets(struct list_head *statefile) { struct fw3_statefile_entry *e; - info("Destroying ipsets ..."); - - list_for_each_entry(e, statefile, list) + if (statefile) { - if (e->type != FW3_TYPE_IPSET) - continue; + info("Destroying ipsets ..."); - info(" * %s", e->name); + list_for_each_entry(e, statefile, list) + { + if (e->type != FW3_TYPE_IPSET) + continue; - fw3_pr("flush %s\n", e->name); - fw3_pr("destroy %s\n", e->name); + info(" * %s", e->name); + + fw3_pr("flush %s\n", e->name); + fw3_pr("destroy %s\n", e->name); + } } }