From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2EA96A04EF; Mon, 25 May 2020 03:46:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09C4D1D68C; Mon, 25 May 2020 03:46:40 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id C0ECA1D664; Mon, 25 May 2020 03:46:36 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 56F7795A89BCFEADA74B; Mon, 25 May 2020 09:46:35 +0800 (CST) Received: from localhost (10.173.251.152) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 25 May 2020 09:46:24 +0800 From: wangyunjian To: CC: , , Yunjian Wang , Date: Mon, 25 May 2020 09:46:23 +0800 Message-ID: <1590371183-22636-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.173.251.152] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] test-pmd: fix memory leaks when mtr policer actions update fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Yunjian Wang This patch fixes the Huawei internal coverity reported resource leak issue. Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- v2: * Update commit log --- app/test-pmd/cmdline_mtr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c index caa7e9864..ee16244de 100644 --- a/app/test-pmd/cmdline_mtr.c +++ b/app/test-pmd/cmdline_mtr.c @@ -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; } -- 2.23.0