[sr-dev] git:master: cfg framework: segfault during exit is fixed

Miklos Tirpak miklos at iptel.org
Wed Oct 20 15:36:21 CEST 2010


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

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Wed Oct 20 15:32:18 2010 +0200

cfg framework: segfault during exit is fixed

Verify that *cfg_global is not NULL when destroying the
configuration.

t_set_fr("@cfg_get.local.invite_timeout", "@cfg_get.local.gw_timeout");
caused a segfault during startup when the variable was not defined.

Reported by Juha Heinanen

---

 cfg/cfg_struct.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index f2f5bfe..11a825d 100644
--- a/cfg/cfg_struct.c
+++ b/cfg/cfg_struct.c
@@ -333,7 +333,7 @@ void cfg_destroy(void)
 	cfg_ctx_destroy();
 
 	/* free the list of groups */
-	cfg_destory_groups(cfg_global ? (*cfg_global)->vars : NULL);
+	cfg_destory_groups((cfg_global && (*cfg_global)) ? (*cfg_global)->vars : NULL);
 
 	/* free the select list */
 	cfg_free_selects();




More information about the sr-dev mailing list