From 357d87e825d837ae81adfd50f2c4271c3bb62df0 Mon Sep 17 00:00:00 2001 From: Harshad Narayane Date: Tue, 27 Sep 2022 00:42:09 -0400 Subject: [PATCH] net/softnic: fix file descriptor leak Fix file close at pipeline code generation. Coverity issue: 380976 Fixes: e3be2495c509 ("net/softnic: add pipeline code generation command") Signed-off-by: Harshad Narayane Signed-off-by: Kamalakannan R Acked-by: Cristian Dumitrescu --- drivers/net/softnic/rte_eth_softnic_cli.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c index f133bebfdd..085523fe03 100644 --- a/drivers/net/softnic/rte_eth_softnic_cli.c +++ b/drivers/net/softnic/rte_eth_softnic_cli.c @@ -230,6 +230,7 @@ cmd_softnic_pipeline_codegen(struct pmd_internals *softnic __rte_unused, code_file = fopen(tokens[3], "w"); if (!code_file) { snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]); + fclose(spec_file); return; }