From 3925e65938e7c778f650d62a721dec7a66c19ab3 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 15 Apr 2021 18:32:47 +0200 Subject: [PATCH] BMP: Add some missing bmp_buffer_free() calls They were inadvertently removed during recent code refactoring. Thanks to Dawid Macek for the bugreport and patch. --- proto/bmp/bmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proto/bmp/bmp.c b/proto/bmp/bmp.c index 550e4c18..dbbb5e0c 100644 --- a/proto/bmp/bmp.c +++ b/proto/bmp/bmp.c @@ -277,6 +277,7 @@ bmp_startup(struct bmp_proto *p) buffer payload = bmp_buffer_alloc(p->buffer_mpool, DEFAULT_MEM_BLOCK_SIZE); bmp_init_msg_serialize(&payload, p->sys_descr, p->sys_name); bmp_schedule_tx_packet(p, bmp_buffer_data(&payload), bmp_buffer_pos(&payload)); + bmp_buffer_free(&payload); p->started = true; } @@ -661,6 +662,7 @@ bmp_send_peer_up_notif_msg(struct bmp_proto *p, const struct bgp_proto *bgp, sk->saddr, sk->daddr, sk->sport, sk->dport, tx_data, tx_data_size, rx_data, rx_data_size); bmp_schedule_tx_packet(p, bmp_buffer_data(&payload), bmp_buffer_pos(&payload)); + bmp_buffer_free(&payload); bmp_peer_up(bgp); } @@ -849,6 +851,9 @@ bmp_route_monitor_update_in_pre_commit(const struct bgp_proto *bgp) bmp_buffer_flush(&payload); bmp_buffer_flush(&update_msgs); } + + bmp_buffer_free(&payload); + bmp_buffer_free(&update_msgs); } void