Explorar o código

prefix_route(s): fix mod_destroy/tree_close()

tree_close(), called from mod_destroy did not take into account
the possibility of mod_init not being run (e.g. startup error).

Reported-by: Klaus Darilion  klaus.mailinglists pernau at
Andrei Pelinescu-Onciul %!s(int64=16) %!d(string=hai) anos
pai
achega
7fc0ed074c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      modules_s/prefix_route/tree.c

+ 3 - 1
modules_s/prefix_route/tree.c

@@ -334,7 +334,9 @@ int tree_init(void)
 
 void tree_close(void)
 {
-	tree_flush(tree_get());
+	if (shared_tree)
+		tree_flush(tree_get());
+	shared_tree = NULL;
 }