cfg framework: segfault during exit is fixed
authorMiklos Tirpak <miklos@iptel.org>
Wed, 20 Oct 2010 13:32:18 +0000 (15:32 +0200)
committerMiklos Tirpak <miklos@iptel.org>
Wed, 20 Oct 2010 13:32:18 +0000 (15:32 +0200)
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

index f2f5bfe..11a825d 100644 (file)
@@ -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();