[Freeswitch-svn] [commit] r8430 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri May 16 10:32:36 EDT 2008


Author: mikej
Date: Fri May 16 10:32:35 2008
New Revision: 8430

Modified:
   freeswitch/trunk/src/switch_core.c

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

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Fri May 16 10:32:35 2008
@@ -369,6 +369,16 @@
 							  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);



More information about the Freeswitch-svn mailing list