[PATCH] examples/pipeline: fix file close
Thomas Monjalon
thomas at monjalon.net
Wed Oct 5 14:34:40 CEST 2022
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 at intel.com>
> Signed-off-by: Kamalakannan R <kamalakannan.r at intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu at 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.
More information about the dev
mailing list