aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2024-06-24 08:18:38 -0700
committerFlorin Coras <florin.coras@gmail.com>2024-06-25 17:11:43 +0000
commit5677c8ac4bb023d45cb41e8b3e3288a0323b7d7b (patch)
tree948880e5b36bf2ab5ecb6e591412ba7cb8186ae1 /src
parent26574dcd4f8608f6149cb93ff847177801105fcd (diff)
session: memory leak in mma rule table
When the rule table is allocated, the root node is allocated. But it cannot be deleted by the add_del API, or the table is useless. When the table is free, the root node is not free and there is memory leak. Let's add pool_flush when the rule table is free. Type: fix Change-Id: I58c3e040cd101c7db501d99a373ad78d85321b8f Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/mma_template.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/session/mma_template.c b/src/vnet/session/mma_template.c
index 4b2770bb756..26a23b2d270 100644
--- a/src/vnet/session/mma_template.c
+++ b/src/vnet/session/mma_template.c
@@ -67,6 +67,9 @@ RT (mma_rule_free) (RTT (mma_rules_table) * srt, RTT (mma_rule) * rule)
void RT (mma_rules_table_free) (RTT (mma_rules_table) * srt)
{
+ RTT (mma_rule) * rule;
+
+ pool_flush (rule, srt->rules, ({}));
pool_free (srt->rules);
}