netfilter: nf_tables: fix memory leak on error exit return
authorColin Ian King <colin.king@canonical.com>
Wed, 9 May 2018 12:22:56 +0000 (13:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 13 May 2018 22:21:59 +0000 (00:21 +0200)
commitf0dfd7a2b35b02030949100247d851b793cb275f
tree0bc300372afa47f3ccda569904fccf12bc6c2df3
parentbb7b40aecbf778c0c83a5bd62b0f03ca9f49a618
netfilter: nf_tables: fix memory leak on error exit return

Currently the -EBUSY error return path is not free'ing resources
allocated earlier, leaving a memory leak. Fix this by exiting via the
error exit label err5 that performs the necessary resource clean
up.

Detected by CoverityScan, CID#1432975 ("Resource leak")

Fixes: 9744a6fcefcb ("netfilter: nf_tables: check if same extensions are set when adding elements")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c