don't use unchecked malloc results. Found by Klockwork (www.klocwork.com)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8430 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-05-16 14:32:35 +00:00
parent 47d42ee110
commit 35dc6b0412
1 changed files with 10 additions and 0 deletions

View File

@ -369,6 +369,16 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
runtime.memory_pool);
switch_safe_free(dir_path);
switch_assert(SWITCH_GLOBAL_dirs.base_dir);
switch_assert(SWITCH_GLOBAL_dirs.mod_dir);
switch_assert(SWITCH_GLOBAL_dirs.conf_dir);
switch_assert(SWITCH_GLOBAL_dirs.log_dir);
switch_assert(SWITCH_GLOBAL_dirs.db_dir);
switch_assert(SWITCH_GLOBAL_dirs.script_dir);
switch_assert(SWITCH_GLOBAL_dirs.htdocs_dir);
switch_assert(SWITCH_GLOBAL_dirs.grammar_dir);
switch_assert(SWITCH_GLOBAL_dirs.temp_dir);
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.base_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.mod_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.conf_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);