DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] graph: fix memory leak in node clone
@ 2024-10-30 12:12 pbhagavatula
  2024-11-01  1:27 ` Huichao cai
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2024-10-30 12:12 UTC (permalink / raw)
  To: jerinj, Kiran Kumar K, Nithin Dabilpuram, Zhirun Yan; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Free memory allocated for the node when xstats memory
allocation fails.

Coverity issue: 445529
Fixes: 070db97e017b ("graph: support node xstats")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/graph/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/graph/node.c b/lib/graph/node.c
index f15922892e..eb685b409f 100644
--- a/lib/graph/node.c
+++ b/lib/graph/node.c
@@ -156,7 +156,7 @@ node_clone(struct node *node, const char *name)
 				     (node->xstats->nb_xstats * RTE_NODE_XSTAT_DESC_SIZE));
 		if (reg->xstats == NULL) {
 			rte_errno = ENOMEM;
-			goto fail;
+			goto free;
 		}
 
 		for (i = 0; i < node->xstats->nb_xstats; i++)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH] graph: fix memory leak in node clone
@ 2024-10-31 13:22 Huichao Cai
  0 siblings, 0 replies; 3+ messages in thread
From: Huichao Cai @ 2024-10-31 13:22 UTC (permalink / raw)
  To: pbhagavatula; +Cc: dev, jerinj, kirankumark, ndabilpuram, yanzhirun_163

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

There is one more place in the node_clone function that needs to be modified:
	if (clone_name(reg->name, node->name, name))
		//goto free;
		goto free_xstat;


从 Windows 版邮件发送


[-- Attachment #2: Type: text/html, Size: 2752 bytes --]

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

end of thread, other threads:[~2024-11-01  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-30 12:12 [PATCH] graph: fix memory leak in node clone pbhagavatula
2024-11-01  1:27 ` Huichao cai
2024-10-31 13:22 Huichao Cai

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