From 59bd944f6d75e99fe0c8d743e7fd482672640c2d Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 1 Jun 2022 10:14:22 +0200 Subject: optimize: segfault when releasing unsupported statement Call xfree() instead since stmt_alloc() does not initialize the statement type fields. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1609 Fixes: ea1f1c9ff608 ("optimize: memleak in statement matrix") Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/optimizations/merge_vmaps | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/shell/testcases/optimizations/merge_vmaps') diff --git a/tests/shell/testcases/optimizations/merge_vmaps b/tests/shell/testcases/optimizations/merge_vmaps index 0922a221..e2e4be15 100755 --- a/tests/shell/testcases/optimizations/merge_vmaps +++ b/tests/shell/testcases/optimizations/merge_vmaps @@ -3,11 +3,16 @@ set -e RULESET="table ip x { + set s { + type ipv4_addr + flags dynamic + } chain filter_in_tcp { } chain filter_in_udp { } chain y { + update @s { ip saddr limit rate 12/minute burst 30 packets } accept tcp dport vmap { 80 : accept, 81 : accept, -- cgit v1.2.3