Skip to contentSkip to conversation

nftables: missing set cleanup in do_command_list

PATCH Applied Phil Oester 2 participants 2 messages Nov 30, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nftables: missing set cleanup in do_command_list

When listing a table in interactive mode, the set list is not cleaned up. Thus the number of displayed sets grows with each successive listing. Attached patch adds the necessary list cleanup to do_command_list.

src/rule.c +5 -0
index 39a66d7..ec8b6a4 100644
@@ -665,6 +665,11 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
 		chain_free(chain);
 	}
 
+	list_for_each_entry_safe(set, nset, &table->sets, list) {
+		list_del(&set->list);
+		set_free(set);
+	}
+
 	return 0;
 }
 
maintainer Applied
#1 lore raw
Quoted 3 lines · Phil Oester

When listing a table in interactive mode, the set list is not cleaned up. Thus the number of displayed sets grows with each successive listing. Attached patch adds the necessary list cleanup to do_command_list.

Applied, thanks.