DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/pipeline: fix file close
@ 2022-09-27  2:29 Harshad Narayane
  0 siblings, 0 replies; 4+ messages in thread
From: Harshad Narayane @ 2022-09-27  2:29 UTC (permalink / raw)
  To: dev; +Cc: Kamalakannan R, Cristian Dumitrescu

Coverity issue: 380860
Fixes: 9043f66a ("examples/pipeline: add command for code generation")

Fix file close at pipeline code generation.

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>
---
 examples/pipeline/cli.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 8013541c4b..1158e51e89 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -545,6 +545,7 @@ cmd_pipeline_codegen(char **tokens,
 	code_file = fopen(tokens[3], "w");
 	if (!code_file) {
 		snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
+		fclose(spec_file);
 		return;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/pipeline: fix file close
  2022-09-27  4:35 Harshad Narayane
@ 2022-10-05 12:34 ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2022-10-05 12:34 UTC (permalink / raw)
  To: Harshad Narayane; +Cc: dev, Kamalakannan R, Cristian Dumitrescu

27/09/2022 06:35, Harshad Narayane:
> Coverity issue: 380860
> Fixes: 9043f66a ("examples/pipeline: add command for code generation")
> 
> Fix file close at pipeline code generation.
> 
> 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>
> ---
> --- a/examples/pipeline/cli.c
> +++ b/examples/pipeline/cli.c
> @@ -545,6 +545,7 @@ cmd_pipeline_codegen(char **tokens,
>  	code_file = fopen(tokens[3], "w");
>  	if (!code_file) {
>  		snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
> +		fclose(spec_file);
>  		return;
>  	}


Reordered lines in the commit log and applied, thanks.
Note: this is not fixing "close", it was missing,
but it is fixing a leak.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] examples/pipeline: fix file close
@ 2022-09-27  4:35 Harshad Narayane
  2022-10-05 12:34 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Harshad Narayane @ 2022-09-27  4:35 UTC (permalink / raw)
  To: dev; +Cc: Kamalakannan R, Cristian Dumitrescu

Coverity issue: 380860
Fixes: 9043f66a ("examples/pipeline: add command for code generation")

Fix file close at pipeline code generation.

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>
---
 examples/pipeline/cli.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 8013541c4b..1158e51e89 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -545,6 +545,7 @@ cmd_pipeline_codegen(char **tokens,
 	code_file = fopen(tokens[3], "w");
 	if (!code_file) {
 		snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
+		fclose(spec_file);
 		return;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] examples/pipeline: fix file close
@ 2022-09-26 10:41 Harshad Narayane
  0 siblings, 0 replies; 4+ messages in thread
From: Harshad Narayane @ 2022-09-26 10:41 UTC (permalink / raw)
  To: dev; +Cc: Kamalakannan R, Cristian Dumitrescu

Coverity issue: 380860
Fixes: 9043f66a ("examples/pipeline: add command for code generation")

Fix file close at pipeline code generation.

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>
---
 examples/pipeline/cli.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 8013541c4b..1158e51e89 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -545,6 +545,7 @@ cmd_pipeline_codegen(char **tokens,
 	code_file = fopen(tokens[3], "w");
 	if (!code_file) {
 		snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
+		fclose(spec_file);
 		return;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-05 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  2:29 [PATCH] examples/pipeline: fix file close Harshad Narayane
  -- strict thread matches above, loose matches on Subject: below --
2022-09-27  4:35 Harshad Narayane
2022-10-05 12:34 ` Thomas Monjalon
2022-09-26 10:41 Harshad Narayane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).