app/testpmd: fix memory leak on error path
authorYunjian Wang <wangyunjian@huawei.com>
Mon, 25 May 2020 01:46:23 +0000 (09:46 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 28 May 2020 15:57:07 +0000 (17:57 +0200)
This patch fixes the resource leak issue.

Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline_mtr.c

index caa7e98..ee16244 100644 (file)
@@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
        ret = rte_mtr_policer_actions_update(port_id, mtr_id,
                action_mask, actions, &error);
        if (ret != 0) {
+               free(actions);
                print_err_msg(&error);
                return;
        }