FS-5779 --resolve

This commit is contained in:
Anthony Minessale 2013-09-12 01:29:32 +05:00
parent 439e582dc6
commit 5714ca0d18
1 changed files with 6 additions and 6 deletions

View File

@ -1639,8 +1639,10 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file)
write_fd = NULL;
if ((fd = open(new_file, O_RDONLY, 0)) > -1) {
if ((xml = switch_xml_parse_fd(fd))) {
xml->free_path = new_file;
new_file = NULL;
if (strcmp(file, SWITCH_GLOBAL_filenames.conf_name)) {
xml->free_path = new_file;
new_file = NULL;
}
}
close(fd);
fd = -1;
@ -2742,10 +2744,8 @@ SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml)
}
if (xml->free_path) {
if (!switch_stristr("freeswitch.xml.fsxml", xml->free_path)) {
if (unlink(xml->free_path) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", xml->free_path);
}
if (unlink(xml->free_path) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", xml->free_path);
}
switch_safe_free(xml->free_path);
}