From: Jo-Philipp Wich Date: Sun, 26 May 2013 14:22:01 +0000 (+0200) Subject: Avoid segfault when freeing rules whose target could not be found X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=commitdiff_plain;h=ace34d11e3874a26a347e346ee405a2ad605a8ae;ds=inline Avoid segfault when freeing rules whose target could not be found --- diff --git a/iptables.c b/iptables.c index cea3fcd..2684933 100644 --- a/iptables.c +++ b/iptables.c @@ -1271,7 +1271,9 @@ free: xtables_rule_matches_free(&r->matches); - free(r->target->t); + if (r->target) + free(r->target->t); + free(r); /* reset all targets and matches */