]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser_bison: ensure all timeout policy names are released
authorFlorian Westphal <fw@strlen.de>
Tue, 12 Dec 2023 12:32:24 +0000 (13:32 +0100)
committerFlorian Westphal <fw@strlen.de>
Fri, 22 Dec 2023 13:44:38 +0000 (14:44 +0100)
commit86a496928420046e9d32317f09db050e8351b10e
tree1c47cf8302e5a2da2776d740ff5f90af39f182d2
parentdcb199544563ded462cb7151134278f82a9e6cfd
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 <fw@strlen.de>
src/parser_bison.y
tests/shell/testcases/bogons/nft-f/ct_timeout_memleak [new file with mode: 0644]