DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Cc: bernard.iremonger@intel.com, john.mcnamara@intel.com
Subject: [dpdk-dev] [PATCH] lib/librte_flow_classify: fix memory leak issue
Date: Mon, 22 Jan 2018 14:14:28 +0000	[thread overview]
Message-ID: <20180122141428.106166-1-jasvinder.singh@intel.com> (raw)

Free allocated memory of the rule if not added to the table.

Fixes: 50bdac5916d9 ("flow_classify: remove table id parameter from API")
Coverity issue: 257032

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 lib/librte_flow_classify/rte_flow_classify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c
index 6fa6a74..55492a6 100644
--- a/lib/librte_flow_classify/rte_flow_classify.c
+++ b/lib/librte_flow_classify/rte_flow_classify.c
@@ -560,6 +560,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 			return rule;
 		}
 	}
+	free(rule);
 	return NULL;
 }
 
-- 
2.9.3

             reply	other threads:[~2018-01-22 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 14:14 Jasvinder Singh [this message]
2018-01-22 14:49 ` Ferruh Yigit
2018-01-25 22:30   ` 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=20180122141428.106166-1-jasvinder.singh@intel.com \
    --to=jasvinder.singh@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@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).