]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
close FSCORE-54
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Oct 2007 19:49:13 +0000 (19:49 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Oct 2007 19:49:13 +0000 (19:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5977 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_xml.c

index b2cf7bc8bd55799851580419e4cd79685e07f563..4efc62eb7d23ab688d4adc0c92c28333c056d0e1 100644 (file)
@@ -1291,6 +1291,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_root(void)
        return MAIN_XML_ROOT;
 }
 
+static char not_so_threadsafe_error_buffer[256] = "";
+
 SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **err)
 {
        char path_buf[1024];
@@ -1312,7 +1314,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e
        snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "freeswitch.xml");
        if ((new_main = switch_xml_parse_file(path_buf))) {
                *err = switch_xml_error(new_main);
-
+               switch_copy_string(not_so_threadsafe_error_buffer, *err, sizeof(not_so_threadsafe_error_buffer));
+               *err = not_so_threadsafe_error_buffer;
                if (!switch_strlen_zero(*err)) {
                        switch_xml_free(new_main);
                        new_main = NULL;