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.
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index fa2d993..9a2a65d 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -180,7 +180,7 @@
 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 @@
 			      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 @@
 
   /* 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)