summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-06-17 17:29:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-06-18 09:40:20 +0200
commit7a0e26723496c268ac639012e882b5dc9ba88f9f (patch)
tree4e1c32f685bad0dde30c19aa97cf8f956c3c2788 /src/rule.c
parentc9ec9cb4af83881712e0f818144673d6f607cd89 (diff)
rule: memleak of list of timeout policies
Release list of ct timeout policy when object is freed. Direct leak of 160 byte(s) in 2 object(s) allocated from: #0 0x7fc0273ad330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330) #1 0x7fc0231377c4 in xmalloc /home/.../devel/nftables/src/utils.c:36 #2 0x7fc023137983 in xzalloc /home/.../devel/nftables/src/utils.c:75 #3 0x7fc0231f64d6 in nft_parse /home/.../devel/nftables/src/parser_bison.y:4448 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 92daf2f3..10569aa7 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1709,6 +1709,14 @@ void obj_free(struct obj *obj)
return;
xfree(obj->comment);
handle_free(&obj->handle);
+ if (obj->type == NFT_OBJECT_CT_TIMEOUT) {
+ struct timeout_state *ts, *next;
+
+ list_for_each_entry_safe(ts, next, &obj->ct_timeout.timeout_list, head) {
+ list_del(&ts->head);
+ xfree(ts);
+ }
+ }
xfree(obj);
}