DPDK patches and discussions
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH v2 1/2] app/test-pmd: fix Coverity issues
Date: Mon, 20 Jun 2016 16:23:06 +0100	[thread overview]
Message-ID: <1466436187-5225-2-git-send-email-remy.horton@intel.com> (raw)
In-Reply-To: <1466436187-5225-1-git-send-email-remy.horton@intel.com>

Fixes memory leaks detected by Coverity. These are due to ephemeral
memory allocations not being freed when errors occur.

Coverity issue 127348: Resource leak

Fixes: e2aae1c1ced9 ("ethdev: remove name from extended statistic fetch")

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 app/test-pmd/config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 10f0a36..cb71c09 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -281,6 +281,7 @@ nic_xstats_display(portid_t port_id)
 	if (cnt_xstats != rte_eth_xstats_get_names(
 			port_id, xstats_names, cnt_xstats)) {
 		printf("Error: Cannot get xstats lookup\n");
+		free(xstats_names);
 		return;
 	}
 
@@ -293,6 +294,8 @@ nic_xstats_display(portid_t port_id)
 	}
 	if (cnt_xstats != rte_eth_xstats_get(port_id, xstats, cnt_xstats)) {
 		printf("Error: Unable to get xstats\n");
+		free(xstats_names);
+		free(xstats);
 		return;
 	}
 
-- 
2.5.5

  reply	other threads:[~2016-06-20 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 13:49 [dpdk-dev] [PATCH v1] app: " Remy Horton
2016-06-20 13:56 ` Thomas Monjalon
2016-06-20 14:50   ` Remy Horton
2016-06-20 15:23 ` [dpdk-dev] [PATCH v2 0/2] " Remy Horton
2016-06-20 15:23   ` Remy Horton [this message]
2016-06-20 15:33     ` [dpdk-dev] [PATCH v2 1/2] app/test-pmd: " De Lara Guarch, Pablo
2016-06-20 15:23   ` [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-keepalive: " Remy Horton
2016-06-21 13:58   ` [dpdk-dev] [PATCH v2 0/2] " 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=1466436187-5225-2-git-send-email-remy.horton@intel.com \
    --to=remy.horton@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@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).