parser_bison: make sure obj_free releases timeout policies
Florian Westphal
maintainerPATCH 1/1 parser_bison: make sure obj_free releases timeout policies
obj_free() won't release them because ->type is still 0 at this point.
Init this to CT_TIMEOUT.
Signed-off-by Florian Westphal <[email protected]>
--- src/parser_bison.y | 1 + .../shell/testcases/bogons/nft-f/ct_timeout_memleak_objfree | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 tests/shell/testcases/bogons/nft-f/ct_timeout_memleak_objfree
src/parser_bison.y +1 -0
@@ -2513,6 +2513,7 @@ ct_timeout_block : /*empty */ { $$ = $<obj>-1; init_list_head(&$$->ct_timeout.timeout_list); + $$->type = NFT_OBJECT_CT_TIMEOUT; } | ct_timeout_block common_block | ct_timeout_block stmt_separator
tests/shell/testcases/bogons/nft-f/ct_timeout_memleak_objfree new file +5 -0
@@ -0,0 +1,5 @@ +table ip filter { + ct timeout cttime { + protocol tcp + l3proto ip + policy = { close : 12s }
Signature · 1 line
2.41.0