Skip to contentSkip to conversation

app/testpmd: fix memory leak for tm object

PATCH Superseded Jasvinder Singh 3 participants 4 messages Nov 5, 2018 – Nov 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix memory leak for tm object

Fixes memory leak for shared shaper object of the traffic manager.

Fixes 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
---
 app/test-pmd/softnicfwd.c | 2 ++
 1 file changed, 2 insertions(+)
app/test-pmd/softnicfwd.c +2 -0
index 7ff622806..94e6669d3 100644
@@ -458,6 +458,7 @@ softport_tm_tc_node_add(portid_t port_id,
 						error->message,
 						shaper_profile_id);
 
+					free(tnp.shared_shaper_id);
 					return -1;
 				}
 				tnp.shaper_profile_id = shaper_profile_id;
@@ -473,6 +474,7 @@ softport_tm_tc_node_add(portid_t port_id,
 						error->message,
 						h->tc_node_id[pos][k]);
 
+					free(tnp.shared_shaper_id);
 					return -1;
 				}
 				shaper_profile_id++;
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 1/1 app/testpmd: fix memory leak for tm object

In reply to Jasvinder Singh

Fixes memory leak for shared shaper object of the traffic manager.

Fixes 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")

---
v2
- cc to [email protected]

 app/test-pmd/softnicfwd.c | 2 ++
 1 file changed, 2 insertions(+)
app/test-pmd/softnicfwd.c +2 -0
index 7ff622806..94e6669d3 100644
@@ -458,6 +458,7 @@ softport_tm_tc_node_add(portid_t port_id,
 						error->message,
 						shaper_profile_id);
 
+					free(tnp.shared_shaper_id);
 					return -1;
 				}
 				tnp.shaper_profile_id = shaper_profile_id;
@@ -473,6 +474,7 @@ softport_tm_tc_node_add(portid_t port_id,
 						error->message,
 						h->tc_node_id[pos][k]);
 
+					free(tnp.shared_shaper_id);
 					return -1;
 				}
 				shaper_profile_id++;
Signature · 1 line
2.17.1
Acked-by on v2 1/1 Applied
#3 lore raw
Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jasvinder Singh
Sent: Tuesday, November 6, 2018 10:23 AM
To: [email protected]
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Wu, Jingjing <[email protected]>; Iremonger, Bernard <[email protected]>
Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix memory leak for tm object

Fixes memory leak for shared shaper object of the traffic manager.

Fixes 5b590fbe09b6 ("app/testpmd: add traffic management forwarding

mode")
Cc: [email protected]

Quoted 9 lines

---
v2
- cc to [email protected]

 app/test-pmd/softnicfwd.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to next-pipeline tree, thanks!