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

Freeswitch SVN mikej at freeswitch.org
Fri May 16 10:35:41 EDT 2008


Author: mikej
Date: Fri May 16 10:35:41 2008
New Revision: 8431

Modified:
   freeswitch/trunk/src/switch_core.c

Log:
check value before using. 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:35:41 2008
@@ -581,12 +581,14 @@
 
 SWITCH_DECLARE(switch_status_t) switch_core_mime_add_type(const char *type, const char *ext)
 {
-	const char *check = (const char *) switch_core_hash_find(runtime.mime_types, ext);
+	const char *check;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
 	switch_assert(type);
 	switch_assert(ext);
 
+	check = (const char *) switch_core_hash_find(runtime.mime_types, ext);
+
 	if (!check) {
 		char *ptype = switch_core_permanent_strdup(type);
 		char *ext_list = strdup(ext);



More information about the Freeswitch-svn mailing list