Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 18.11-rc3
[deb_dpdk.git]
/
examples
/
ip_pipeline
/
cli.c
diff --git
a/examples/ip_pipeline/cli.c
b/examples/ip_pipeline/cli.c
index
3de6206
..
9103862
100644
(file)
--- 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:
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);
if (f)
fclose(f);