Optimise nfq_queue_cb
PATCH 1/1 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 <[email protected]>
--- src/cthelper.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
src/cthelper.c +3 -5
@@ -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:
Signature · 1 line
1.9.1
Quoted 2 lines · Paul Aitken
ct and myct have both already been checked for non-NULL, so there's no need to check either of them again later.
Applied, thanks.