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:
@@ -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);
