X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fcli.c;h=910386282455a64b95b2d94f9082743f915570f2;hb=refs%2Ftags%2Fupstream%2F18.11-rc3;hp=3de6206820c81d0919124da7fe13698c61f488e5;hpb=88fab00d4402af240c1b7cc2566133aece115488;p=deb_dpdk.git 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);