From a633d869ccf491c4a2d8aa68b4bd8fe51724467a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 14 Nov 2017 19:44:29 -0500 Subject: [PATCH] bgpd: XMALLOC usage causes borken assumption in route_match_peer_free The usage of XMALLOC for route_match_peer_compile causes the pc->interface to be non-NULL. The code assumes that pc->interface will be NULL. Ticket: CM-18824 Signed-off-by: Donald Sharp --- bgpd/bgp_routemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index f26498fb03..45487aa003 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -299,7 +299,7 @@ static void *route_match_peer_compile(const char *arg) struct bgp_match_peer_compiled *pc; int ret; - pc = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, + pc = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(struct bgp_match_peer_compiled)); ret = str2sockunion(strcmp(arg, "local") ? arg : "0.0.0.0", &pc->su); -- 2.39.5