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

FreeSWITCH SVN mrene at freeswitch.org
Thu Mar 5 13:09:46 PST 2009


Author: mrene
Date: Thu Mar  5 15:09:46 2009
New Revision: 12471

Log:
oops[]

Modified:
   freeswitch/trunk/src/switch_xml_config.c

Modified: freeswitch/trunk/src/switch_xml_config.c
==============================================================================
--- freeswitch/trunk/src/switch_xml_config.c	(original)
+++ freeswitch/trunk/src/switch_xml_config.c	Thu Mar  5 15:09:46 2009
@@ -41,7 +41,7 @@
 	
 	if (!*event) {
 		switch_event_create(event, SWITCH_EVENT_REQUEST_PARAMS);
-		switch_assert(event);
+		switch_assert(*event);
 	}
 
 	for (node = xml; node; node = node->next) {
@@ -58,7 +58,7 @@
 
 SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int reload, switch_xml_config_item_t *instructions)
 {
-	switch_event_t *event;
+	switch_event_t *event = NULL;
 	switch_status_t result;
 	int count = switch_event_import_xml(xml, "name", "value", &event);
 	
@@ -165,14 +165,14 @@
 							/* We have a preallocated buffer */
 							char *dest = (char*)item->ptr;
 						
-							if (strncasecmp(dest, newstring, string_options->length)) {
+							if (!dest || strncasecmp(dest, newstring, string_options->length)) {
 								switch_copy_string(dest, newstring, string_options->length);
 								changed = SWITCH_TRUE;
 							}
 						} else {
 							char **dest = (char**)item->ptr;
 						
-							if (strcasecmp(*dest, newstring)) {
+							if (!*dest || strcasecmp(*dest, newstring)) {
 								if (string_options->pool) {
 									*dest = switch_core_strdup(string_options->pool, newstring);
 								} else {



More information about the Freeswitch-svn mailing list