aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-04-27 04:42:47 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-04-27 13:15:55 +0000
commitcbe8d65068c9c39ca6b1f7e116dac2744835f18c (patch)
treeccb3000db4278ef3ecba65af72fc8aea69b22ce4 /src/vnet/interface.c
parent164e5f8c63652028ecb9c3570e1ea8618b163071 (diff)
TAP memory leaks:
1 - use bit-map to re-use ID values and thus VLIB nodes 2 - free vrings 3 - free hw_address on HW interface delete (a HW * struct is memset on pool_get) 4 - free temporary node names during TX node setup Change-Id: Id114c8bb9c844fd4ceb02fbbeb4b511ecfeb61ce Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r--src/vnet/interface.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 13ad65ee2db..d3ad896be12 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -717,7 +717,7 @@ vnet_register_interface (vnet_main_t * vnm,
vnet_feature_config_main_t *fcm;
vnet_config_main_t *cm;
u32 hw_index, i;
- char *tx_node_name, *output_node_name;
+ char *tx_node_name = NULL, *output_node_name = NULL;
pool_get (im->hw_interfaces, hw);
memset (hw, 0, sizeof (*hw));
@@ -907,6 +907,8 @@ no_output_nodes:
VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE);
vnet_hw_interface_set_flags_helper (vnm, hw_index, /* flags */ 0,
VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE);
+ vec_free (tx_node_name);
+ vec_free (output_node_name);
return hw_index;
}
@@ -973,6 +975,7 @@ vnet_delete_hw_interface (vnet_main_t * vnm, u32 hw_if_index)
hash_unset_mem (im->hw_interface_by_name, hw->name);
vec_free (hw->name);
+ vec_free (hw->hw_address);
vec_free (hw->input_node_thread_index_by_queue);
vec_free (hw->dq_runtime_index_by_queue);