summaryrefslogtreecommitdiffstats
path: root/src/plugins/map/ip4_map.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-11-17 09:16:09 +0100
committerMatthew Smith <mgsmith@netgate.com>2022-03-11 21:46:00 +0000
commite41fa7790f9a88fb55df6ed017fda75c6343becc (patch)
treedc9250ce5ac2cdb17f9fd98b63c49cfee48f7804 /src/plugins/map/ip4_map.c
parentdcd08b278fe366e43decbf1c1029f979985cb37b (diff)
map: fix memory leak
Thanks to Ben McKeegan <ben@netservers.co.uk> for the report. Type: fix Change-Id: I8170dda572c326b6b1823fd330dbd5e961fdad74 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/map/ip4_map.c')
-rw-r--r--src/plugins/map/ip4_map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/map/ip4_map.c b/src/plugins/map/ip4_map.c
index 1ab5cc2dc4f..710bd1003b4 100644
--- a/src/plugins/map/ip4_map.c
+++ b/src/plugins/map/ip4_map.c
@@ -155,6 +155,7 @@ ip4_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
map_main_t *mm = &map_main;
vlib_combined_counter_main_t *cm = mm->domain_counters;
u32 thread_index = vm->thread_index;
+ u32 *buffer0 = 0;
while (n_left_from > 0)
{
@@ -170,7 +171,6 @@ ip4_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
ip6_header_t *ip6h0;
u32 next0 = IP4_MAP_NEXT_IP6_LOOKUP;
u32 map_domain_index0 = ~0;
- u32 *buffer0 = 0;
bool free_original_buffer0 = false;
u32 *frag_from0, frag_left0;
@@ -322,6 +322,7 @@ ip4_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
vlib_put_next_frame (vm, node, next_index, n_left_to_next);
}
+ vec_free (buffer0);
return frame->n_vectors;
}