From 340594a929d91387c620c17d89f6592984d6088f Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 5 Mar 2020 16:15:32 -0500 Subject: [PATCH] bgpd: properly initialize SRv6 attributes We were using XMALLOC for these, and only initializing the refcount to 0 on one of them. Let's just use XCALLOC instead... Signed-off-by: Quentin Young --- bgpd/bgp_attr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index ea8a2c97b..33466957b 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2512,9 +2512,8 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length, return bgp_attr_malformed( args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total); } - attr->srv6_vpn = XMALLOC(MTYPE_BGP_SRV6_VPN, + attr->srv6_vpn = XCALLOC(MTYPE_BGP_SRV6_VPN, sizeof(struct bgp_attr_srv6_vpn)); - attr->srv6_vpn->refcnt = 0; attr->srv6_vpn->sid_flags = sid_flags; sid_copy(&attr->srv6_vpn->sid, &ipv6_sid); } @@ -2555,7 +2554,7 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length, return bgp_attr_malformed( args, BGP_NOTIFY_UPDATE_MAL_ATTR, args->total); } - attr->srv6_l3vpn = XMALLOC(MTYPE_BGP_SRV6_L3VPN, + attr->srv6_l3vpn = XCALLOC(MTYPE_BGP_SRV6_L3VPN, sizeof(struct bgp_attr_srv6_l3vpn)); attr->srv6_l3vpn->sid_flags = sid_flags; attr->srv6_l3vpn->endpoint_behavior = endpoint_behavior; -- 2.39.5