diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-14 05:37:08 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-14 05:40:54 +0100 |
commit | 9b50aa1fd3f38eb34d77b9ae7e848b35bc814bfc (patch) | |
tree | abce0e2c4baea59d678a3de9d6239c85ed598f9e /ospfd/ospf_sr.c | |
parent | ospf6d: Fix a possible deref by null found in SA (diff) | |
download | frr-9b50aa1fd3f38eb34d77b9ae7e848b35bc814bfc.tar.xz frr-9b50aa1fd3f38eb34d77b9ae7e848b35bc814bfc.zip |
ospfd: Fix some new SA issues found by coverity
Fix a || && mixup.
Add an assert for area to show we expect it to be non-null
going forward.
When memory is allocated if it fails we abort then
no need to check for null.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r-- | ospfd/ospf_sr.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index c6649a7a0..9827eac71 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -149,14 +149,6 @@ static struct sr_node *sr_node_new(struct in_addr *rid) new->ext_link->del = del_sr_link; new->ext_prefix->del = del_sr_pref; - /* Check if list are correctly created */ - if (new->ext_link == NULL || new->ext_prefix == NULL) { - list_delete_original(new->ext_link); - list_delete_original(new->ext_prefix); - XFREE(MTYPE_OSPF_SR_PARAMS, new); - return NULL; - } - IPV4_ADDR_COPY(&new->adv_router, rid); new->neighbor = NULL; new->instance = 0; @@ -440,7 +432,7 @@ static struct ospf_path *get_nexthop_by_addr(struct ospf *top, struct route_node *rn; /* Sanity Check */ - if ((top == NULL) && (top->new_table)) + if (top == NULL) return NULL; if (IS_DEBUG_OSPF_SR) |