From 80c0ae24378f249b3be9a02774d844c13143cd99 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 13 Oct 2022 05:39:11 +0000 Subject: vlib: Counter free needs to NULL the allocated counter vector otherwise the next time the counter is validated this is dangling. Type: fix Fixes: 58fd481d73 Signed-off-by: Neale Ranns Change-Id: Ifa8d5ff27175cf6dfb30cbf023fa3251fe5c780e --- src/plugins/unittest/counter_test.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/unittest') diff --git a/src/plugins/unittest/counter_test.c b/src/plugins/unittest/counter_test.c index 65c03fe89f1..71f8f93f94d 100644 --- a/src/plugins/unittest/counter_test.c +++ b/src/plugins/unittest/counter_test.c @@ -89,6 +89,9 @@ test_simple_counter_expand (vlib_main_t *vm) epoch = new_epoch; } + vlib_free_simple_counter (&counter); + vlib_validate_simple_counter (&counter, 0); + return 0; } @@ -136,6 +139,9 @@ test_combined_counter_expand (vlib_main_t *vm) epoch = new_epoch; } + vlib_free_combined_counter (&counter); + vlib_validate_combined_counter (&counter, 0); + return 0; } -- cgit 1.2.3-korg