[Freeswitch-svn] [commit] r11977 - in freeswitch/trunk/src/mod/applications: mod_commands mod_dptools

FreeSWITCH SVN anthm at freeswitch.org
Thu Feb 12 16:08:12 PST 2009


Author: anthm
Date: Thu Feb 12 18:08:12 2009
New Revision: 11977

Log:
potential xml root readlock issue

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Thu Feb 12 18:08:12 2009
@@ -347,9 +347,11 @@
 	if ((domain = strchr(user, '@'))) {
 		*domain++ = '\0';
 	} else {
-		domain = "cluecon.com";
+		if (!(domain = switch_core_get_variable("domain"))) {
+			domain = "cluecon.com";
+		}
 	}
-
+	
 	switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
 	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "user", user);
 	switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", user);
@@ -465,16 +467,17 @@
 			}
 		}
 
-		if (xml && x_user) {
+		if (x_user) {
 			xmlstr = switch_xml_toxml(x_user, SWITCH_FALSE);
 			switch_assert(xmlstr);
 
 			stream->write_function(stream, "%s", xmlstr);
 			free(xmlstr);
-			switch_xml_free(xml);
 		}
 	}
-
+	
+	switch_xml_free(xml);
+			
 	free(mydata);
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -683,18 +686,17 @@
 		}
 	}
 
-	if (xml && obj) {
+	if (obj) {
 		xmlstr = switch_xml_toxml(obj, SWITCH_FALSE);
 		switch_assert(xmlstr);
-
 		stream->write_function(stream, "%s", xmlstr);
 		free(xmlstr);
-		switch_xml_free(xml);
-
 	}
 
+	switch_xml_free(xml);
 	switch_event_destroy(&params);
 	free(mydata);
+
 	return SWITCH_STATUS_SUCCESS;
 }
 

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Thu Feb 12 18:08:12 2009
@@ -2391,9 +2391,7 @@
 
   done:
 
-	if (xml) {
-		switch_xml_free(xml);
-	}
+	switch_xml_free(xml);
 
 	if (params) {
 		switch_event_destroy(&params);



More information about the Freeswitch-svn mailing list