From 86a496928420046e9d32317f09db050e8351b10e Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 12 Dec 2023 13:32:24 +0100 Subject: parser_bison: ensure all timeout policy names are released We need to add a custom destructor for this structure, it contains the dynamically allocated names. a:5:55-55: Error: syntax error, unexpected '}', expecting string policy = { estabQisheestablished : 2m3s, cd : 2m3s, } ==562373==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 160 byte(s) in 2 object(s) allocated from: #1 0x5a565b in xmalloc src/utils.c:31:8 #2 0x5a565b in xzalloc src/utils.c:70:8 #3 0x3d9352 in nft_parse_bison_filename src/libnftables.c:520:8 [..] Fixes: c7c94802679c ("src: add ct timeout support") Signed-off-by: Florian Westphal --- tests/shell/testcases/bogons/nft-f/ct_timeout_memleak | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/shell/testcases/bogons/nft-f/ct_timeout_memleak (limited to 'tests/shell/testcases') diff --git a/tests/shell/testcases/bogons/nft-f/ct_timeout_memleak b/tests/shell/testcases/bogons/nft-f/ct_timeout_memleak new file mode 100644 index 00000000..014525a3 --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/ct_timeout_memleak @@ -0,0 +1,7 @@ +table ip filter { + ct timeout cttime { + protocol tcp + l3proto ip + policy = { estabQisheestablished : 2m3s, cd : 2m3s, } + } +} -- cgit v1.2.3