diff options
author | Pierre Pfister <ppfister@cisco.com> | 2018-09-12 14:08:53 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-09-12 14:14:52 +0000 |
commit | 350155329c6075cef48b2d6934329a7ad75cf5c8 (patch) | |
tree | b6f7c0bcb799772c2dd43b9c4e05863cbbeafba6 /src/plugins/lb/lb.c | |
parent | e849da24498a865c61af4e96198f23914c2377e3 (diff) |
Fix LB memory leak and remove useless code
Vector sort_arr was actually never freed.
This change also removes some nearby code which
happens to be totally useless.
Change-Id: I2f265c1b4770cbcd75a2fb69ea54e46e1b54245a
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'src/plugins/lb/lb.c')
-rw-r--r-- | src/plugins/lb/lb.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c index 42103eeef2a..601b297ffe8 100644 --- a/src/plugins/lb/lb.c +++ b/src/plugins/lb/lb.c @@ -383,7 +383,6 @@ static void lb_vip_update_new_flow_table(lb_vip_t *vip) lb_new_flow_entry_t *new_flow_table = 0; lb_as_t *as; lb_pseudorand_t *pr, *sort_arr = 0; - u32 count; ASSERT (lbm->writer_lock[0]); //We must have the lock @@ -408,7 +407,6 @@ out: } //First, let's sort the ASs - sort_arr = 0; vec_alloc(sort_arr, pool_elts(vip->as_indexes)); i = 0; @@ -463,16 +461,8 @@ out: } } - vec_free(sort_arr); - finished: - -//Count number of changed entries - count = 0; - for (i=0; i<vec_len(new_flow_table); i++) - if (vip->new_flow_table == 0 || - new_flow_table[i].as_index != vip->new_flow_table[i].as_index) - count++; + vec_free(sort_arr); old_table = vip->new_flow_table; vip->new_flow_table = new_flow_table; |