[sr-dev] git:master: prefix_route(s): fix mod_destroy/tree_close()

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Jul 8 18:06:13 CEST 2009


Module: sip-router
Branch: master
Commit: 7fc0ed074caa98f1542a5b741f00b01078c730fc
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7fc0ed074caa98f1542a5b741f00b01078c730fc

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Wed Jul  8 17:54:46 2009 +0200

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

---

 modules_s/prefix_route/tree.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules_s/prefix_route/tree.c b/modules_s/prefix_route/tree.c
index 94fc0f5..57f07e2 100644
--- a/modules_s/prefix_route/tree.c
+++ b/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;
 }
 
 




More information about the sr-dev mailing list