]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix memory leak if expr init fails
authorLiping Zhang <liping.zhang@spreadtrum.com>
Mon, 20 Jun 2016 13:11:45 +0000 (21:11 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Jun 2016 12:15:24 +0000 (14:15 +0200)
commit48b99d316f43b049583da91eb32d045bb3a501db
tree4d072f4a097bc572a3eb971923a3d73a81f695fb
parent6b817e912f09622d9161b57bd809e6c5d0f09cc1
netfilter: nf_tables: fix memory leak if expr init fails

If expr init fails then we need to free it.

So when the user add a nft rule as follows:

  # nft add rule filter input tcp dport 22 flow table ssh \
    { ip saddr limit rate 0/second }

memory leak will happen.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c