diff options
author | Neale Ranns <neale@graphiant.com> | 2022-10-13 05:39:11 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2022-10-17 05:44:34 +0000 |
commit | 994d86f70e1957b30d18eebdd6a06634153b2308 (patch) | |
tree | 92d2dd6f8bba5798e85859e489e74351d4c5a350 /src/vlib | |
parent | 13c7e8f7a1d89076c06cc383e1a4049ed88d6439 (diff) |
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 <neale@graphiant.com>
Change-Id: Ifa8d5ff27175cf6dfb30cbf023fa3251fe5c780e
(cherry picked from commit 80c0ae24378f249b3be9a02774d844c13143cd99)
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/counter.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vlib/counter.c b/src/vlib/counter.c index 4f375dee938..9f14d02909f 100644 --- a/src/vlib/counter.c +++ b/src/vlib/counter.c @@ -108,7 +108,10 @@ vlib_free_simple_counter (vlib_simple_counter_main_t * cm) vec_free (cm->counters); } else - vlib_stats_remove_entry (cm->stats_entry_index); + { + vlib_stats_remove_entry (cm->stats_entry_index); + cm->counters = NULL; + } } void @@ -176,7 +179,10 @@ vlib_free_combined_counter (vlib_combined_counter_main_t * cm) vec_free (cm->counters); } else - vlib_stats_remove_entry (cm->stats_entry_index); + { + vlib_stats_remove_entry (cm->stats_entry_index); + cm->counters = NULL; + } } u32 |