From 35dc6b04124755191ba30a988b070435c66279bd Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 16 May 2008 14:32:35 +0000 Subject: [PATCH] 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 --- src/switch_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/switch_core.c b/src/switch_core.c index b575049850..b25c9e2618 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -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);