app/testpmd: fix memory leak for TM object
authorJasvinder Singh <jasvinder.singh@intel.com>
Tue, 6 Nov 2018 10:23:06 +0000 (10:23 +0000)
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>
Mon, 12 Nov 2018 16:45:31 +0000 (17:45 +0100)
Fixes memory leak for shared shaper object of the traffic manager.

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/softnicfwd.c

index 7ff6228..94e6669 100644 (file)
@@ -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++;