diff options
author | paul <paul> | 2004-09-24 08:23:24 +0000 |
---|---|---|
committer | paul <paul> | 2004-09-24 08:23:24 +0000 |
commit | 1603c06ba3ad07b8f9380209a137569abe3700e1 (patch) | |
tree | 75c26cd35b85585810e4ebe555d37f24d751971e | |
parent | a257068354604e1d20391a6b69bdd2ba02945754 (diff) |
2004-09-24 Paul Jakma <paul@dishone.st>
* ospf_apiserver.{c,h}: (ospf_apiserver_term) loops calling
ospf_apiserver_free, which deletes referenced nodes from
apiserver_list, fixed.
-rw-r--r-- | ospfd/ChangeLog | 2 | ||||
-rw-r--r-- | ospfd/ospf_apiserver.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index 8f1ffb68..53ae8f29 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -5,6 +5,8 @@ fixups. (ospf_apiserver_unregister_opaque_type) fix listnode_delete of referenced node in loop. + (ospf_apiserver_term) loops calling ospf_apiserver_free, which + deletes referenced nodes from apiserver_list, fixed. * ospf_interface.h: lists typedef removal cleanup. * ospf_opaque.{c,h}: lists typedef removal cleanup. update some list loops to LIST_LOOP. miscellaneous style and indent fixups. diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index fa2d9930..9a2a65d1 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -180,7 +180,7 @@ out: void ospf_apiserver_term (void) { - struct listnode *node; + struct listnode *node, *nnode; struct ospf_apiserver *apiserv; /* Unregister wildcard [0/0] type */ @@ -188,7 +188,7 @@ ospf_apiserver_term (void) 0 /* all opaque types */); /* Free all client instances */ - LIST_LOOP (apiserver_list, apiserv, node) + while ( (node = listhead (apiserver_list)) != NULL) ospf_apiserver_free (apiserv); /* Free client list itself */ @@ -1177,7 +1177,7 @@ ospf_apiserver_notify_ready_type11 (struct ospf_apiserver *apiserv) /* Can type 11 be originated? */ if (!ospf_apiserver_is_ready_type11 (ospf)) - goto out;; + goto out; /* Check for registered opaque type 11 types */ LIST_LOOP (apiserv->opaque_types, r, node) |