isisd: Segmentation fault on isis daemon fixes

I have a fix for 2 segmentation fault scenarios on the isis daemon:
1. When running a command "isis passive" on an interface in the
following context:
"end"
"configure terminal "
"interface dummy0"
"isis passive"
The trace back collected:
isis_adjacency.c:521
family=2,
     root_sysid=0x20aee6d0 "", parent=0x20af4d68) at isis_spf.c:999
sysid=0x20aee6d0 "")
     at isis_spf.c:1217
isis_spf.c:1372
isis_lsp.c:416
isis_lsp.c:1660
isis_main.c:368

The fix location:
file name: isisd/isis_adjacency.c
routine name: isis_adj_build_up_list

2. When deleting the existing isis router instance:
"end"
"configure terminal "
"no router isis DEAD"

The fix location:
isisd/isis_events.c, routine circuit_resign_level
isisd/isis_lsp.c, routine lsp_destroy
isisd/isis_route.c, isis_route_validate

The trace back collection:
"DEAD") at isisd.c:252
argc=1, argv=0xbfc39054) at isisd.c:1520
vty=0x20d6f528, cmd=0x0) at command.c:2121
cmd=0x0, vtysh=0) at command.c:2155
isis DEAD") at vty.c:433
isis_main.c:368

and

"DEAD") at isisd.c:260
argc=1, argv=0xbfd6cf54) at isisd.c:1520
vty=0x208cb528, cmd=0x0) at command.c:2121
cmd=0x0, vtysh=0) at command.c:2155
isis DEAD") at vty.c:433
isis_main.c:368

The patch is included.

patchwork #833: http://patchwork.quagga.net/patch/833/
diff --git a/isisd/isis_events.c b/isisd/isis_events.c
index 0dee9e6..26f0210 100644
--- a/isisd/isis_events.c
+++ b/isisd/isis_events.c
@@ -250,8 +250,10 @@
       THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[idx]);
       circuit->lsp_regenerate_pending[idx] = 0;
       circuit->u.bc.run_dr_elect[idx] = 0;
-      list_delete (circuit->u.bc.lan_neighs[idx]);
-      circuit->u.bc.lan_neighs[idx] = NULL;
+      if (circuit->u.bc.lan_neighs[idx] != NULL) {
+        list_delete (circuit->u.bc.lan_neighs[idx]);
+        circuit->u.bc.lan_neighs[idx] = NULL;
+      }
     }
 
   return;