mirror of https://gitee.com/openkylin/linux.git
netfilter: nftables: Fix a memleak from userdata error path in new objects
Release object name if userdata allocation fails.
Fixes: b131c96496
("netfilter: nf_tables: add userdata support for nft_object")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
198ad97383
commit
85dfd816fa
|
@ -6615,9 +6615,9 @@ static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,
|
|||
INIT_LIST_HEAD(&obj->list);
|
||||
return err;
|
||||
err_trans:
|
||||
kfree(obj->key.name);
|
||||
err_userdata:
|
||||
kfree(obj->udata);
|
||||
err_userdata:
|
||||
kfree(obj->key.name);
|
||||
err_strdup:
|
||||
if (obj->ops->destroy)
|
||||
obj->ops->destroy(&ctx, obj);
|
||||
|
|
Loading…
Reference in New Issue