From 122eebd85a9562391af33451d1c323aa87ab400b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 30 May 2018 17:55:04 -0400 Subject: [PATCH] bgpd: Fix memory use after free We were immediately using memory after it was freed. Fix. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 132fa5fc9d..a6322b1e06 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -207,9 +207,9 @@ static void bgp_info_free(struct bgp_info *binfo) { /* unlink reference to parent, if any. */ if (binfo->extra && binfo->extra->parent) { - bgp_info_unlock((struct bgp_info *)binfo->extra->parent); bgp_unlock_node((struct bgp_node *)((struct bgp_info *)binfo ->extra->parent)->net); + bgp_info_unlock((struct bgp_info *)binfo->extra->parent); binfo->extra->parent = NULL; } -- 2.39.5