From 3735936bdad243b207fd5a65b9686ec19c5a0a7d Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Mon, 12 Jun 2017 06:46:56 +0000 Subject: [PATCH] bgpd: free notify packet after writing Signed-off-by: Quentin Young --- bgpd/bgp_packet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 750c0119c9..c243f4b0e3 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -514,6 +514,7 @@ static int bgp_write_notify(struct peer *peer) /* only connection reset/close gets counted as TCP_fatal_error, failure * to write the entire NOTIFY doesn't get different FSM treatment */ if (ret <= 0) { + stream_free(s); BGP_EVENT_ADD(peer, TCP_fatal_error); return 0; } @@ -543,6 +544,8 @@ static int bgp_write_notify(struct peer *peer) Connect instead of Idle */ BGP_EVENT_ADD(peer, BGP_Stop); + stream_free(s); + return 0; }