diff options
author | paul <paul> | 2005-10-23 15:26:24 +0000 |
---|---|---|
committer | paul <paul> | 2005-10-23 15:26:24 +0000 |
commit | e029d448587551be7543e64e278dbb566f57509a (patch) | |
tree | 7ce8c2a0a69634c377c2e0180fecc6ad2cfa6eca /ospfd | |
parent | b8ad39d47a0fea7a336305cfd04f059c8e797aad (diff) |
2005-10-23 Paul Jakma <paul.jakma@sun.com>
* ospf_apiserver.c: (ospf_apiserver_term) This function should
not have side-effects (eg segv) if no apiserver instances are
active, ie be robust.
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ChangeLog | 3 | ||||
-rw-r--r-- | ospfd/ospf_apiserver.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index a4461258..72412d74 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,5 +1,8 @@ 2005-10-23 Paul Jakma <paul.jakma@sun.com> + * ospf_apiserver.c: (ospf_apiserver_term) This function should + not have side-effects (eg segv) if no apiserver instances are + active, ie be robust. * ospf_vty.c: (show_ip_ospf) fix display of SPF timer if it has not yet been run. diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index 784716b5..577419da 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -189,11 +189,13 @@ ospf_apiserver_term (void) * Free all client instances. ospf_apiserver_free removes the node * from the list, so we examine the head of the list anew each time. */ - while ( (apiserv = listgetdata (listhead (apiserver_list))) != NULL) + while ( apiserver_list && + (apiserv = listgetdata (listhead (apiserver_list))) != NULL) ospf_apiserver_free (apiserv); /* Free client list itself */ - list_delete (apiserver_list); + if (apiserver_list) + list_delete (apiserver_list); /* Free wildcard list */ /* XXX */ |