]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
potential xml root readlock issue
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 13 Feb 2009 00:08:12 +0000 (00:08 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 13 Feb 2009 00:08:12 +0000 (00:08 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11977 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c
src/mod/applications/mod_dptools/mod_dptools.c

index a863f91df9894dcc5cd19c2cefd2661634cec63f..1dfcd3d5884595b270a45f25c460aa9ee89d163d 100644 (file)
@@ -347,9 +347,11 @@ SWITCH_STANDARD_API(user_data_function)
        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 @@ static switch_status_t _find_user(const char *cmd, switch_core_session_t *sessio
                        }
                }
 
-               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 @@ SWITCH_STANDARD_API(xml_locate_function)
                }
        }
 
-       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;
 }
 
index ae41c4bc3d5c7666e6a717aaa2c2ec85300c9880..0b345823de556b23403c5e880626d72b8f0ec7e3 100644 (file)
@@ -2391,9 +2391,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
 
   done:
 
-       if (xml) {
-               switch_xml_free(xml);
-       }
+       switch_xml_free(xml);
 
        if (params) {
                switch_event_destroy(&params);