summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_opaque.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_opaque.c')
-rw-r--r--ospfd/ospf_opaque.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index bc71e371b..5a1f28b03 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -113,7 +113,7 @@ void ospf_opaque_term(void)
int ospf_opaque_type9_lsa_init(struct ospf_interface *oi)
{
if (oi->opaque_lsa_self != NULL)
- list_delete(oi->opaque_lsa_self);
+ list_delete_and_null(&oi->opaque_lsa_self);
oi->opaque_lsa_self = list_new();
oi->opaque_lsa_self->del = free_opaque_info_per_type;
@@ -125,7 +125,7 @@ void ospf_opaque_type9_lsa_term(struct ospf_interface *oi)
{
OSPF_TIMER_OFF(oi->t_opaque_lsa_self);
if (oi->opaque_lsa_self != NULL)
- list_delete(oi->opaque_lsa_self);
+ list_delete_and_null(&oi->opaque_lsa_self);
oi->opaque_lsa_self = NULL;
return;
}
@@ -133,7 +133,7 @@ void ospf_opaque_type9_lsa_term(struct ospf_interface *oi)
int ospf_opaque_type10_lsa_init(struct ospf_area *area)
{
if (area->opaque_lsa_self != NULL)
- list_delete(area->opaque_lsa_self);
+ list_delete_and_null(&area->opaque_lsa_self);
area->opaque_lsa_self = list_new();
area->opaque_lsa_self->del = free_opaque_info_per_type;
@@ -154,15 +154,14 @@ void ospf_opaque_type10_lsa_term(struct ospf_area *area)
OSPF_TIMER_OFF(area->t_opaque_lsa_self);
if (area->opaque_lsa_self != NULL)
- list_delete(area->opaque_lsa_self);
- area->opaque_lsa_self = NULL;
+ list_delete_and_null(&area->opaque_lsa_self);
return;
}
int ospf_opaque_type11_lsa_init(struct ospf *top)
{
if (top->opaque_lsa_self != NULL)
- list_delete(top->opaque_lsa_self);
+ list_delete_and_null(&top->opaque_lsa_self);
top->opaque_lsa_self = list_new();
top->opaque_lsa_self->del = free_opaque_info_per_type;
@@ -183,8 +182,7 @@ void ospf_opaque_type11_lsa_term(struct ospf *top)
OSPF_TIMER_OFF(top->t_opaque_lsa_self);
if (top->opaque_lsa_self != NULL)
- list_delete(top->opaque_lsa_self);
- top->opaque_lsa_self = NULL;
+ list_delete_and_null(&top->opaque_lsa_self);
return;
}
@@ -287,16 +285,16 @@ static void ospf_opaque_funclist_term(void)
struct list *funclist;
funclist = ospf_opaque_wildcard_funclist;
- list_delete(funclist);
+ list_delete_and_null(&funclist);
funclist = ospf_opaque_type9_funclist;
- list_delete(funclist);
+ list_delete_and_null(&funclist);
funclist = ospf_opaque_type10_funclist;
- list_delete(funclist);
+ list_delete_and_null(&funclist);
funclist = ospf_opaque_type11_funclist;
- list_delete(funclist);
+ list_delete_and_null(&funclist);
return;
}
@@ -616,7 +614,7 @@ static void free_opaque_info_per_type(void *val)
}
OSPF_TIMER_OFF(oipt->t_opaque_lsa_self);
- list_delete(oipt->id_list);
+ list_delete_and_null(&oipt->id_list);
XFREE(MTYPE_OPAQUE_INFO_PER_TYPE, oipt);
return;
}