cur = xmlDocGetRootElement(doc);
if (cur == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document. doc path(%s, %p)", path, doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
}
if (xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_BASE_TAG)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT 'tts-engine'");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT 'tts-engine'. doc path(%s, %p)", path, doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
cur = cur->xmlChildrenNode;
if (cur == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document. doc path(%s, %p)", path, doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
tts_engine_info_s* temp;
temp = (tts_engine_info_s*)calloc(1, sizeof(tts_engine_info_s));
if (NULL == temp) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Out of memory");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Out of memory. doc path(%s, %p)", path, doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
temp->text_size = TTS_MAX_TEXT_SIZE;
}
- xmlFreeDoc(doc);
- doc = NULL;
+ if (NULL != doc) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] doc path(%s, %p)", path, doc);
+ xmlFreeDoc(doc);
+ doc = NULL;
+ }
if (NULL == temp->uuid) {
/* Invalid engine */
cur = xmlDocGetRootElement(doc);
if (cur == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document(%p)", doc);
xmlFreeDoc(doc);
doc = NULL;
xmlCleanupParser();
}
if (xmlStrcmp(cur->name, (const xmlChar *) TTS_TAG_CONFIG_BASE_TAG)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT %s", TTS_TAG_CONFIG_BASE_TAG);
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT %s. doc(%p)", TTS_TAG_CONFIG_BASE_TAG, doc);
xmlFreeDoc(doc);
doc = NULL;
xmlCleanupParser();
cur = cur->xmlChildrenNode;
if (cur == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document(%p)", doc);
xmlFreeDoc(doc);
doc = NULL;
xmlCleanupParser();
tts_config_s* temp;
temp = (tts_config_s*)calloc(1, sizeof(tts_config_s));
if (NULL == temp) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Out of memory");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Out of memory(%p)", doc);
xmlFreeDoc(doc);
doc = NULL;
xmlCleanupParser();
int tts_parser_unload_config(tts_config_s* config_info)
{
if (NULL != g_config_doc) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] Free g_config_doc(%p)", g_config_doc);
xmlFreeDoc(g_config_doc);
g_config_doc = NULL;
}
if (NULL != config_info) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] Free config_info(%p)", config_info);
free(config_info);
config_info = NULL;
}
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to change file mode : %d", ret);
}
- xmlFreeDoc(doc);
- doc = NULL;
+ if (NULL != doc) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] doc(%p)", doc);
+ xmlFreeDoc(doc);
+ doc = NULL;
+ }
+
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[SUCCESS] Copying xml");
return 0;
cur_new = xmlDocGetRootElement(doc);
cur_old = xmlDocGetRootElement(g_config_doc);
if (cur_new == NULL || cur_old == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document(%p)", doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
if (xmlStrcmp(cur_new->name, (const xmlChar*)TTS_TAG_CONFIG_BASE_TAG) ||
xmlStrcmp(cur_old->name, (const xmlChar*)TTS_TAG_CONFIG_BASE_TAG)) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT %s", TTS_TAG_CONFIG_BASE_TAG);
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] The wrong type, root node is NOT %s. doc(%p)", TTS_TAG_CONFIG_BASE_TAG, doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
cur_new = cur_new->xmlChildrenNode;
cur_old = cur_old->xmlChildrenNode;
if (cur_new == NULL || cur_old == NULL) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document");
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Empty document(%p)", doc);
xmlFreeDoc(doc);
doc = NULL;
return -1;
}
if (NULL != g_config_doc) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] Free g_config_doc(%p)", g_config_doc);
xmlFreeDoc(g_config_doc);
g_config_doc = NULL;
}
SLOG(LOG_DEBUG, TAG_TTSCONFIG, "[DEBUG] Reset g_config_doc as %s", TTS_DEFAULT_CONFIG);
if (NULL != g_config_doc) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[DEBUG] Free g_config_doc(%p)", g_config_doc);
xmlFreeDoc(g_config_doc);
g_config_doc = NULL;
}