diff options
author | Ole Troan <ot@cisco.com> | 2019-06-16 12:33:51 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-06-18 13:01:15 +0000 |
commit | 92e3082199d10add866894e86a9762d79a3536c4 (patch) | |
tree | 224d269fba3ec3b0c5ca456a7ede032d4163335d /src/vlib/error.c | |
parent | ae8819f0a426953aa7ebf97c2e26940525b55fb1 (diff) |
stats: fix memory leakage when adding / deleting interfaces
This fixes two leaks in registering errors in the stats segment.
- The error name created by vlib_register_errors() was not freed.
- Duplicate error names (when interface readded) was added to the vector.
This fix also adds memory usage statistics for the statistics segment
as /mem/statseg/{used, total}
Change-Id: Ife98d5fc5baef5bdae426a5a1eef428af2b9ab8a
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlib/error.c')
-rw-r--r-- | src/vlib/error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlib/error.c b/src/vlib/error.c index 7c61f319fc0..ef506635ad9 100644 --- a/src/vlib/error.c +++ b/src/vlib/error.c @@ -166,7 +166,7 @@ vlib_register_errors (vlib_main_t * vm, { error_name = format (0, "/err/%v/%s%c", n->name, error_strings[i], 0); /* Note: error_name consumed by the following call */ - vlib_stats_register_error_index (error_name, em->counters, + vlib_stats_register_error_index (oldheap, error_name, em->counters, n->error_heap_index + i); } } |