X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=includes.c;h=a9a75cbdaedd5b7aa8aab01d264b4faa4720af51;hp=42d5b7a856dee6afeb1098c6a5402c48af95bff5;hb=097282eace13feb4a115b55d497588bf2b550f62;hpb=294f209f64dca84d1c4dd801a1f7e615e39f0726 diff --git a/includes.c b/includes.c index 42d5b7a..a9a75cb 100644 --- a/includes.c +++ b/includes.c @@ -1,7 +1,7 @@ /* * firewall3 - 3rd OpenWrt UCI firewall implementation * - * Copyright (C) 2013 Jo-Philipp Wich + * Copyright (C) 2013 Jo-Philipp Wich * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -47,13 +47,10 @@ fw3_load_includes(struct fw3_state *state, struct uci_package *p) if (strcmp(s->type, "include")) continue; - include = malloc(sizeof(*include)); - + include = calloc(1, sizeof(*include)); if (!include) continue; - memset(include, 0, sizeof(*include)); - include->name = e->name; include->enabled = true; @@ -135,7 +132,8 @@ fw3_print_includes(struct fw3_state *state, enum fw3_family family, bool reload) print_include(include); } - fw3_command_close(); + if (exec) + fw3_command_close(); }