diff options
author | Phil Sutter <phil@nwl.cc> | 2020-05-04 19:30:29 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-05-11 14:28:29 +0200 |
commit | 5fdb447fdfe877bd6236830b4a2507d4d61bc1a1 (patch) | |
tree | a8d83c947d620c99e3a3abb97361d501371167f4 /libiptc/linux_stddef.h | |
parent | 196401937d76f990ad59a4a93cd5a45e91a2b12a (diff) |
nft: Fix leaks in ebt_add_policy_rule()
The function leaked memory allocated in temporary struct
iptables_command_state, clean it immediately after use.
In any of the udata-related error cases, allocated nftnl_rule would
leak, fix this by introducing a common error path to goto.
In regular code path, the allocated nftnl_rule would still leak:
batch_obj_del() does not free rules in NFT_COMPAT_RULE_APPEND jobs, as
they typically sit in cache as well. Policy rules in turn weren't added
to cache: They are created immediately before commit and never
referenced from other rules. Add them now so they are freed just like
regular rules.
Fixes: aff1162b3e4b7 ("ebtables-nft: Support user-defined chain policies")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'libiptc/linux_stddef.h')
0 files changed, 0 insertions, 0 deletions