[ospfd] CID #49, fix dereference before NULL check
2006-05-11 Paul Jakma <paul.jakma@sun.com>
* ospf_route.c: (ospf_route_delete_same_ext) Fix deref before
NULL check by moving into check-protected block, fix CID #49.
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 6cb83f9..a66cfa0 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -6,6 +6,8 @@
result, fixes Coverity CID #70.
(no_ospf_area_filter_list) Check NULL result from
ospf_area_lookup_by_area_id, fixes Coverity CID #69
+ * ospf_route.c: (ospf_route_delete_same_ext) Fix deref before
+ NULL check by moving into check-protected block, fix CID #49.
2006-04-24 Paul Jakma <paul.jakma@sun.com>
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 646b625..e0f2565 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -195,9 +195,9 @@
struct prefix_ipv4 *p = (struct prefix_ipv4 *)(&rn->p);
if ( (ext_rn = route_node_lookup (external_routes, (struct prefix *)p)) )
{
- ospf_zebra_delete (p, ext_rn->info);
if (ext_rn->info)
{
+ ospf_zebra_delete (p, ext_rn->info);
ospf_route_free( ext_rn->info);
ext_rn->info = NULL;
}