From: Paul Aitken <paitken@brocade.com>
To: <netfilter-devel@vger.kernel.org>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [PATCH] Optimise nfq_queue_cb
Date: Mon, 1 Jun 2015 10:22:00 +0100 [thread overview]
Message-ID: <556C2438.3060203@brocade.com> (raw)
In-Reply-To: <md5:KJl5IfCAjtPWb+o93HAjWA==>
ct and myct have both already been checked for non-NULL,
so there's no need to check either of them again later.
Signed-off-by: Paul Aitken <paitken@brocade.com>
---
src/cthelper.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/cthelper.c b/src/cthelper.c
index 15d5126..6537515 100644
--- a/src/cthelper.c
+++ b/src/cthelper.c
@@ -325,14 +325,12 @@ static int nfq_queue_cb(const struct nlmsghdr *nlh, void *data)
if (pkt_verdict_issue(helper, myct, queue_num, id, verdict, pktb) < 0)
goto err_pktb;
- if (ct != NULL)
- nfct_destroy(ct);
+ nfct_destroy(ct);
if (myct->exp != NULL)
nfexp_destroy(myct->exp);
- if (myct && myct->priv_data != NULL)
+ if (myct->priv_data != NULL)
free(myct->priv_data);
- if (myct != NULL)
- free(myct);
+ free(myct);
return MNL_CB_OK;
err_pktb:
--
1.9.1
next parent reply other threads:[~2015-06-01 9:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <md5:KJl5IfCAjtPWb+o93HAjWA==>
2015-06-01 9:22 ` Paul Aitken [this message]
2015-06-01 11:03 ` [PATCH] Optimise nfq_queue_cb Pablo Neira Ayuso
2015-06-01 11:19 ` Paul Aitken
2015-06-01 17:34 ` Pablo Neira Ayuso
2015-06-04 9:13 ` Paul Aitken
2015-06-04 9:15 Paul Aitken
2015-06-12 13:08 ` Pablo Neira Ayuso
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=556C2438.3060203@brocade.com \
--to=paitken@brocade.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.