From ddced90c76fb00e2141478a3573c42b72a526fe6 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 16 Feb 2009 15:16:48 +0100 Subject: [PATCH] src/filter_chain.c: Made match_proc_t.create optional. In most cases it does not make sense to not provide a create callback. However, we never know what the future might bring, so let's chose the more flexible approach. --- src/filter_chain.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/filter_chain.c b/src/filter_chain.c index 70a37bf6..9a52f7c9 100644 --- a/src/filter_chain.c +++ b/src/filter_chain.c @@ -268,19 +268,21 @@ static int fc_config_add_match (fc_match_t **matches_head, /* {{{ */ sstrncpy (m->name, ptr->name, sizeof (m->name)); memcpy (&m->proc, &ptr->proc, sizeof (m->proc)); - assert (m->proc.create != NULL); m->user_data = NULL; m->next = NULL; - status = (*m->proc.create) (ci, &m->user_data); - if (status != 0) + if (m->proc.create != NULL) { - WARNING ("Filter subsystem: Failed to create a %s match.", - m->name); - fc_free_matches (m); - return (-1); + status = (*m->proc.create) (ci, &m->user_data); + if (status != 0) + { + WARNING ("Filter subsystem: Failed to create a %s match.", + m->name); + fc_free_matches (m); + return (-1); + } } - + if (*matches_head != NULL) { ptr = *matches_head; -- 2.11.0