aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ip_pipeline
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-11-14 11:13:11 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2018-11-14 11:13:28 +0000
commit8a853e3f0275efc8b05cb195085d45946942744a (patch)
treef7b349012231726c54fedd6c19f9cbf8234a4458 /examples/ip_pipeline
parent88fab00d4402af240c1b7cc2566133aece115488 (diff)
New upstream version 18.11-rc3upstream/18.11-rc3
Change-Id: I958b9d019027ef049bd992b3968a667f3ae382ae Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/ip_pipeline')
-rw-r--r--examples/ip_pipeline/cli.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 3de62068..91038628 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -6841,20 +6841,26 @@ cli_rule_file_process(const char *file_name,
return 0;
cli_rule_file_process_free:
- *rule_list = NULL;
- *n_rules = rule_id;
- *line_number = line_id;
+ if (rule_list != NULL)
+ *rule_list = NULL;
- for ( ; ; ) {
- struct table_rule *rule;
+ if (n_rules != NULL)
+ *n_rules = rule_id;
- rule = TAILQ_FIRST(list);
- if (rule == NULL)
- break;
+ if (line_number != NULL)
+ *line_number = line_id;
- TAILQ_REMOVE(list, rule, node);
- free(rule);
- }
+ if (list != NULL)
+ for ( ; ; ) {
+ struct table_rule *rule;
+
+ rule = TAILQ_FIRST(list);
+ if (rule == NULL)
+ break;
+
+ TAILQ_REMOVE(list, rule, node);
+ free(rule);
+ }
if (f)
fclose(f);