}
}
+static void free_filter_confs(void)
+{
+ int i;
+ struct filter_node *fn;
+
+ FOR_EACH_FILTER_NODE(fn, fc, i)
+ free(fn->conf);
+}
+
static int init_filter_chain(void)
{
int i, ret;
if (!conf.filter_given)
return -E_NO_FILTERS;
fc->num_filters = conf.filter_given;
- fc->filter_nodes = para_malloc(fc->num_filters * sizeof(struct filter_node));
+ fc->filter_nodes = para_calloc(fc->num_filters * sizeof(struct filter_node));
fc->inbufp = &sit->buf;
fc->in_loaded = &sit->loaded;
fc->input_error = &sit->task.error;
open_filters();
return 1;
err:
+ free_filter_confs();
free(fc->filter_nodes);
return ret;
}
s.default_timeout.tv_sec = 1;
s.default_timeout.tv_usec = 0;
ret = schedule(&s);
+ free_filter_confs();
close_filters(fc);
out:
free(sit->buf);