]> git.ipfire.org Git - thirdparty/iptables.git/commit
nft: Avoid memleak in error path of nft_cmd_new()
authorPhil Sutter <phil@nwl.cc>
Wed, 2 Jun 2021 09:55:20 +0000 (11:55 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 7 Jun 2021 12:50:27 +0000 (14:50 +0200)
commiteab75ed36a4f204ddab0c40ba42c5a300634d5c3
tree33beaba88517be6c18f5d86fb6ec84ed12f9bb65
parentffe88f8f01263687e82ef4d3d2bdc0cb5444711e
nft: Avoid memleak in error path of nft_cmd_new()

If rule allocation fails, free the allocated 'cmd' before returning to
caller.

Fixes: a7f1e208cdf9c ("nft: split parsing from netlink commands")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-cmd.c