net/softnic: fix file descriptor leak
Fix file close at pipeline code generation.
Coverity issue: 380976
Fixes: e3be2495c5
("net/softnic: add pipeline code generation command")
Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
parent
167756c117
commit
357d87e825
@ -230,6 +230,7 @@ cmd_softnic_pipeline_codegen(struct pmd_internals *softnic __rte_unused,
|
|||||||
code_file = fopen(tokens[3], "w");
|
code_file = fopen(tokens[3], "w");
|
||||||
if (!code_file) {
|
if (!code_file) {
|
||||||
snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
|
snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
|
||||||
|
fclose(spec_file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user