[PATCH] examples/pipeline: fix memory free

Harshad Narayane harshad.suresh.narayane at intel.com
Tue Sep 27 06:37:32 CEST 2022


Coverity issue: 380863
Coverity issue: 380866
Fixes: 6bc14d9f ("examples/pipeline: add command for shared library build")

Fix memory resource free for buffer allocation failure at pipeline
library build.

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

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 1158e51e89..e1e7aaddc1 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -642,7 +642,7 @@ cmd_pipeline_libbuild(char **tokens,
 	buffer = malloc(MAX_LINE_SIZE);
 	if (!buffer) {
 		snprintf(out, out_size, MSG_OUT_OF_MEMORY);
-		return;
+		goto free;
 	}
 
 	snprintf(buffer,
-- 
2.25.1



More information about the dev mailing list