summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-06-11 22:44:20 -0700
committerSteven Luong <sluong@cisco.com>2019-06-14 16:01:42 -0700
commit4221c8de596f3f3f66b4cbb36ad2d0c23486030c (patch)
tree923e60a542d400dd53dd56b51051a930cda6c9e9 /src/vlib
parentf61a1a89959a413d0dd57b24f1c4b7aaf79ef70b (diff)
acl vnet vlib: memory leaks
Fix memory leaks in acl, vnet, and vlib components. Type: fix Change-Id: I61c84ebbacbbf3215db0d4aaa7699e8d5f8df2da Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/error.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/vlib/error.c b/src/vlib/error.c
index 691e6396d97..ca5b87c95b9 100644
--- a/src/vlib/error.c
+++ b/src/vlib/error.c
@@ -219,18 +219,19 @@ vlib_register_errors (vlib_main_t * vm,
/* (re)register the em->counters base address, switch back to main heap */
vlib_stats_pop_heap2 (em->counters, vm->thread_index, oldheap);
- {
- elog_event_type_t t;
- uword i;
+ if (VLIB_ELOG_MAIN_LOOP > 0)
+ {
+ elog_event_type_t t;
+ uword i;
- clib_memset (&t, 0, sizeof (t));
- for (i = 0; i < n_errors; i++)
- {
- t.format = (char *) format (0, "%v %s: %%d",
- n->name, error_strings[i]);
- vm->error_elog_event_types[n->error_heap_index + i] = t;
- }
- }
+ clib_memset (&t, 0, sizeof (t));
+ for (i = 0; i < n_errors; i++)
+ {
+ t.format = (char *) format (0, "%v %s: %%d",
+ n->name, error_strings[i]);
+ vm->error_elog_event_types[n->error_heap_index + i] = t;
+ }
+ }
}
static clib_error_t *