diff mbox series

app/testpmd: fix memory leak for tm object

Message ID 20181105162152.31301-1-jasvinder.singh@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Cristian Dumitrescu
Headers show
Series app/testpmd: fix memory leak for tm object | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Singh, Jasvinder Nov. 5, 2018, 4:21 p.m. UTC
Fixes memory leak for shared shaper object of the traffic manager.

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

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 app/test-pmd/softnicfwd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ferruh Yigit Nov. 5, 2018, 7:34 p.m. UTC | #1
On 11/5/2018 4:21 PM, Jasvinder Singh wrote:
> Fixes memory leak for shared shaper object of the traffic manager.
> 
> Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

- needs stable tag: "Cc: stable@dpdk.org"
diff mbox series

Patch

diff --git a/app/test-pmd/softnicfwd.c b/app/test-pmd/softnicfwd.c
index 7ff622806..94e6669d3 100644
--- a/app/test-pmd/softnicfwd.c
+++ b/app/test-pmd/softnicfwd.c
@@ -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++;