diff options
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r-- | bgpd/bgp_packet.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 6aec5e633..d378be639 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -642,8 +642,13 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code, } } bgp_notify_print (peer, &bgp_notify, "sending"); + if (bgp_notify.data) - XFREE (MTYPE_TMP, bgp_notify.data); + { + XFREE (MTYPE_TMP, bgp_notify.data); + bgp_notify.data = NULL; + bgp_notify.length = 0; + } } /* peer reset cause */ @@ -1734,7 +1739,11 @@ bgp_notify_receive (struct peer *peer, bgp_size_t size) bgp_notify_print(peer, &bgp_notify, "received"); if (bgp_notify.data) - XFREE (MTYPE_TMP, bgp_notify.data); + { + XFREE (MTYPE_TMP, bgp_notify.data); + bgp_notify.data = NULL; + bgp_notify.length = 0; + } } /* peer count update */ |