diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index 1d2ba3bf58..ac5cdd6acb 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -899,15 +899,13 @@ int community_list_set(struct community_list_handler *ch, const char *name, } } - if (str) { - if (style == COMMUNITY_LIST_STANDARD) - com = community_str2com(str); - else - regex = bgp_regcomp(str); + if (style == COMMUNITY_LIST_STANDARD) + com = community_str2com(str); + else + regex = bgp_regcomp(str); - if (!com && !regex) - return COMMUNITY_LIST_ERR_MALFORMED_VAL; - } + if (!com && !regex) + return COMMUNITY_LIST_ERR_MALFORMED_VAL; entry = community_entry_new(); entry->direct = direct; diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index ecc84533b0..dc9bd3cff5 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1467,13 +1467,12 @@ static mpls_label_t _vpn_leak_from_vrf_get_per_nexthop_label( /* Unlink from any existing nexthop cache. Free the entry if unused. */ bgp_mplsvpn_path_nh_label_unlink(pi); - if (blnc) { - /* updates NHT pi list reference */ - LIST_INSERT_HEAD(&(blnc->paths), pi, label_nh_thread); - pi->label_nexthop_cache = blnc; - pi->label_nexthop_cache->path_count++; - blnc->last_update = monotime(NULL); - } + + /* updates NHT pi list reference */ + LIST_INSERT_HEAD(&(blnc->paths), pi, label_nh_thread); + pi->label_nexthop_cache = blnc; + pi->label_nexthop_cache->path_count++; + blnc->last_update = monotime(NULL); /* then add or update the selected nexthop */ if (!blnc->nh) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 7ef9db9f0d..04bdba1345 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9199,6 +9199,8 @@ DEFPY(af_label_vpn_export_allocation_mode, bool old_per_nexthop, new_per_nexthop; afi = vpn_policy_getafi(vty, bgp, false); + if (afi == AFI_MAX) + return CMD_WARNING_CONFIG_FAILED; old_per_nexthop = !!CHECK_FLAG(bgp->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_LABEL_PER_NEXTHOP); @@ -20663,6 +20665,7 @@ DEFUN (community_list_standard, argv_find(argv, argc, "AA:NN", &idx); char *str = argv_concat(argv, argc, idx); + assert(str); int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq, direct, style); @@ -20775,6 +20778,7 @@ DEFUN (community_list_expanded_all, argv_find(argv, argc, "AA:NN", &idx); char *str = argv_concat(argv, argc, idx); + assert(str); int ret = community_list_set(bgp_clist, cl_name_or_number, str, seq, direct, style); diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index 2237a611e8..a056267bf7 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -842,9 +842,6 @@ static void eigrp_update_send_GR_part(struct eigrp_neighbor *nbr) eigrp_fsm_event(&fsm_msg); } - /* NULL the pointer */ - dest_addr = NULL; - /* delete processed prefix from list */ listnode_delete(prefixes, pe); diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c index 6713dbc967..7715eab0a8 100644 --- a/zebra/zebra_mlag.c +++ b/zebra/zebra_mlag.c @@ -338,8 +338,6 @@ static void zebra_mlag_post_data_from_main_thread(struct event *thread) } } - stream_free(s); - return; stream_failure: stream_free(s); if (zebra_s) diff --git a/zebra/zserv.c b/zebra/zserv.c index 6abd49310c..d2367007cf 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -507,8 +507,6 @@ static void zserv_process_messages(struct event *thread) stream_fifo_push(cache, msg); } - msg = NULL; - /* Need to reschedule processing work if there are still * packets in the fifo. */