summaryrefslogtreecommitdiff
path: root/examples/ip_pipeline/cli.c
diff options
context:
space:
mode:
authorJasvinder Singh <jasvinder.singh@intel.com>2018-04-16 17:03:11 +0100
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>2018-05-08 13:10:41 +0200
commit9b60795143bbdf03bcf266492f72c4286d316c71 (patch)
treebce8fbda3fd2435c5601377e0f557a4a9ad4eec9 /examples/ip_pipeline/cli.c
parent0015ea276725a5e2a8f634b76c67a524c0c0a3ca (diff)
downloaddpdk-9b60795143bbdf03bcf266492f72c4286d316c71.zip
dpdk-9b60795143bbdf03bcf266492f72c4286d316c71.tar.gz
dpdk-9b60795143bbdf03bcf266492f72c4286d316c71.tar.xz
examples/ip_pipeline: fix leak on DSCP parsing
Close the file stream before returning from the function to avoid memory leak. Coverity issue: 272605 Fixes: 2b82ef4861c0 ("examples/ip_pipeline: add DSCP table update command") Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Diffstat (limited to 'examples/ip_pipeline/cli.c')
-rw-r--r--examples/ip_pipeline/cli.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 199a31f..20fbefb 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -4158,6 +4158,7 @@ load_dscp_table(struct rte_table_action_dscp_table *dscp_table,
if (parse_tokenize_string(line, tokens, &n_tokens)) {
*line_number = l;
+ fclose(f);
return -EINVAL;
}
@@ -4172,6 +4173,7 @@ load_dscp_table(struct rte_table_action_dscp_table *dscp_table,
(tc_queue_id >= RTE_TABLE_ACTION_TC_QUEUE_MAX) ||
(strlen(tokens[2]) != 1)) {
*line_number = l;
+ fclose(f);
return -EINVAL;
}
@@ -4193,6 +4195,7 @@ load_dscp_table(struct rte_table_action_dscp_table *dscp_table,
default:
*line_number = l;
+ fclose(f);
return -EINVAL;
}