aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-10-20 14:36:13 +0200
committerDave Barach <openvpp@barachs.net>2020-10-20 19:41:19 +0000
commit2f535e68441f1f856a00f8f5a3b64aff213123de (patch)
tree323b2e4d78d8476229487c0016bcbc3225889d4a /src
parent0ff7eec2f5b4a1b161399a209bf04d61b0ac165b (diff)
stats: crash when adding/deleting interfaces
create tap delete tap tap0 create loopback interface delete loopback interface intfc loop0 create tap <- here I hit a segmentation fault Type: fix Fixes: 148c7b768721231325a349fa82db693190513b53 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If270cc57610e2ded7422e7030d8c1f9fadd4d233
Diffstat (limited to 'src')
-rw-r--r--src/vlib/error.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vlib/error.c b/src/vlib/error.c
index 7f69140abe2..7d502d777a3 100644
--- a/src/vlib/error.c
+++ b/src/vlib/error.c
@@ -131,11 +131,12 @@ vlib_register_errors (vlib_main_t * vm,
if (n->n_errors > 0)
heap_dealloc (em->counters_heap, n->error_heap_handle);
+ n->n_errors = n_errors;
+ n->error_counters = counters;
+
if (n_errors == 0)
return;
- n->n_errors = n_errors;
-
/* Legacy node */
if (!counters)
{
@@ -149,8 +150,6 @@ vlib_register_errors (vlib_main_t * vm,
}
}
- n->error_counters = counters;
-
n->error_heap_index =
heap_alloc (em->counters_heap, n_errors, n->error_heap_handle);
l = vec_len (em->counters_heap);