diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-06 00:06:43 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-06 00:52:52 +0300 |
commit | 85dfd816fabfc16e71786eda0a33a7046688b5b0 (patch) | |
tree | f2598ec20ff4cb379ae877482df9666cb305d4f1 | |
parent | 198ad973839ca4686f3575155ba9ff178289905f (diff) | |
download | linux-85dfd816fabfc16e71786eda0a33a7046688b5b0.tar.xz |
netfilter: nftables: Fix a memleak from userdata error path in new objects
Release object name if userdata allocation fails.
Fixes: b131c96496b3 ("netfilter: nf_tables: add userdata support for nft_object")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/nf_tables_api.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0b7fe0a902ff..926da6ed8d51 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -6615,9 +6615,9 @@ err_obj_ht: 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); |