DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, bernard.iremonger@intel.com,
	jingjing.wu@intel.com, wenzhuo.lu@intel.com
Subject: [dpdk-dev] [PATCH] testpmd: fix memory leak for dscp table
Date: Wed, 14 Nov 2018 11:58:59 +0000	[thread overview]
Message-ID: <20181114115859.160722-1-jasvinder.singh@intel.com> (raw)

Fix memory leak for dscp table reported by coverity

Coverity ID: 326961
Fixes: 281eeb8afc55 ("app/testpmd: add commands for metering and policing")
CC: stable@dpdk.org

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

diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index 846de88db..c506d87ee 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -1148,15 +1148,15 @@ static void cmd_set_port_meter_dscp_table_parsed(void *parsed_result,
 	}
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
+		goto free_table;
 
 	/* Update Meter DSCP Table*/
 	ret = rte_mtr_meter_dscp_table_update(port_id, mtr_id,
 		dscp_table, &error);
-	if (ret != 0) {
+	if (ret != 0)
 		print_err_msg(&error);
-		return;
-	}
+
+free_table:
 	free(dscp_table);
 }
 
-- 
2.17.1

             reply	other threads:[~2018-11-14 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 11:58 Jasvinder Singh [this message]
2018-11-18 20:36 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181114115859.160722-1-jasvinder.singh@intel.com \
    --to=jasvinder.singh@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).