bgpd: Initialise prd despite if it's safi-related or not

Fixes: d33bd63126 ("bgpd: fix coverity issue in bgpd")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-09-20 15:05:35 +03:00
parent da1cf4f151
commit cbbdcee7a8

View File

@ -6597,7 +6597,7 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str,
int ret; int ret;
struct prefix p; struct prefix p;
struct bgp_static *bgp_static; struct bgp_static *bgp_static;
struct prefix_rd prd; struct prefix_rd prd = {};
struct bgp_dest *pdest; struct bgp_dest *pdest;
struct bgp_dest *dest; struct bgp_dest *dest;
struct bgp_table *table; struct bgp_table *table;
@ -6626,7 +6626,6 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str,
} }
if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN) { if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN) {
memset(&prd, 0, sizeof(prd));
ret = str2prefix_rd(rd_str, &prd); ret = str2prefix_rd(rd_str, &prd);
if (!ret) { if (!ret) {
vty_out(vty, "%% Malformed rd\n"); vty_out(vty, "%% Malformed rd\n");