diff options
author | Paul Aitken <paitken@brocade.com> | 2015-06-04 10:15:00 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-06-12 14:11:39 +0200 |
commit | 0d48c76df2736fc3ab9b17dd97fa456cf98ee9e6 (patch) | |
tree | 71475268a23b9ac765d8e10796ce81f0fef58065 | |
parent | 6dcfe88a27318e313c1cb9130177a839926fe042 (diff) | |
download | conntrack-tools-0d48c76df2736fc3ab9b17dd97fa456cf98ee9e6.tar.gz conntrack-tools-0d48c76df2736fc3ab9b17dd97fa456cf98ee9e6.zip |
cthelper: Optimise nfq_queue_cb
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/cthelper.c | 8 |
1 files 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: |