summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorSamanvitha B Bhargav <bsamanvitha@vmware.com>2022-09-21 12:18:06 +0200
committerSamanvitha B Bhargav <bsamanvitha@vmware.com>2022-09-23 09:14:12 +0200
commitb96b4f1c5fa9ad2ba78b3b9f602dcdc794296309 (patch)
tree13f7adc0ece56c2c738a98d3cae08dd7236d1f74 /bgpd/bgp_fsm.c
parentbgpd: memory leak issue fix (diff)
downloadfrr-b96b4f1c5fa9ad2ba78b3b9f602dcdc794296309.tar.xz
frr-b96b4f1c5fa9ad2ba78b3b9f602dcdc794296309.zip
bgpd: Cleanup memory leaks associated with t_deferral_timer
We are allocating temporary memory for information about what to process in this thread, which is not being cleaned up on thread cancelling. Signed-off-by: Samanvitha B Bhargav <bsmanvitha@vmware.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index a8accc25f..ddda10077 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1464,6 +1464,11 @@ int bgp_stop(struct peer *peer)
/* There is no pending EOR message */
if (gr_info->eor_required == 0) {
+ if (gr_info->t_select_deferral) {
+ void *info = THREAD_ARG(
+ gr_info->t_select_deferral);
+ XFREE(MTYPE_TMP, info);
+ }
THREAD_OFF(gr_info->t_select_deferral);
gr_info->eor_received = 0;
}