DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/pipeline: fix memory free
@ 2022-09-27  4:37 Harshad Narayane
  2022-10-05 12:30 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Harshad Narayane @ 2022-09-27  4:37 UTC (permalink / raw)
  To: dev; +Cc: Kamalakannan R, Cristian Dumitrescu

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@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@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


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

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

27/09/2022 06:37, Harshad Narayane:
> 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@intel.com>
> Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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




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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  4:37 [PATCH] examples/pipeline: fix memory free Harshad Narayane
2022-10-05 12:30 ` Thomas Monjalon

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).