Merge pull request #2547 from pacovn/Coverity_1458168_Dereference_null_return_value

eigrpd ospfd: null check (Coverity 1458168 1455335)
This commit is contained in:
Russ White 2018-06-26 11:14:07 -04:00 committed by GitHub
commit 884cc57a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -448,6 +448,8 @@ void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest)
struct eigrp_nexthop_entry *entry;
struct eigrp *eigrp = eigrp_lookup();
assert(eigrp);
for (ALL_LIST_ELEMENTS_RO(dest->entries, node, entry)) {
if (entry->reported_distance < dest->fdistance) {
// is feasible successor, can be successor

View File

@ -243,13 +243,14 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)
zlog_debug(
"%s: Create new ospf instance with vrf_name %s vrf_id %u",
__PRETTY_FUNCTION__, name, new->vrf_id);
if (vrf)
ospf_vrf_link(new, vrf);
} else {
new->vrf_id = VRF_DEFAULT;
vrf = vrf_lookup_by_id(VRF_DEFAULT);
ospf_vrf_link(new, vrf);
}
if (vrf)
ospf_vrf_link(new, vrf);
ospf_zebra_vrf_register(new);
new->abr_type = OSPF_ABR_DEFAULT;