if (NULL == temp) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory");
xmlFreeDoc(doc);
+ doc = NULL;
return -1;
}
}
temp->name = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_NAME);
}
}
temp->uuid = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_ID);
}
}
temp->setting = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_SETTING);
}
temp_voice->type = (int)TTS_CONFIG_VOICE_TYPE_USER_DEFINED;
}
xmlFree(attr);
+ attr = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_VOICE_TYPE);
free(temp_voice);
}
temp_voice->language = strdup((char*)key);
xmlFree(key);
+ key = NULL;
temp->voices = g_slist_append(temp->voices, temp_voice);
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_VOICE);
doc = xmlParseFile(TTS_DEFAULT_CONFIG);
if (doc == NULL) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", TTS_DEFAULT_CONFIG);
+ xmlCleanupParser();
return -1;
}
is_default_open = true;
if (TTS_RETRY_COUNT == retry_count) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", TTS_CONFIG);
+ xmlCleanupParser();
return -1;
}
}
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Empty document");
xmlFreeDoc(doc);
doc = NULL;
+ xmlCleanupParser();
return -1;
}
SLOG(LOG_ERROR, tts_tag(), "[ERROR] The wrong type, root node is NOT %s", TTS_TAG_CONFIG_BASE_TAG);
xmlFreeDoc(doc);
doc = NULL;
+ xmlCleanupParser();
return -1;
}
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Empty document");
xmlFreeDoc(doc);
doc = NULL;
+ xmlCleanupParser();
return -1;
}
if (NULL == temp) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory");
xmlFreeDoc(doc);
+ doc = NULL;
+ xmlCleanupParser();
return -1;
}
}
temp->engine_id = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] engine id is NULL");
}
}
temp->setting = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] setting path is NULL");
}
}
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] voice type is NULL");
}
}
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] voice type is NULL");
}
}
temp->language = strdup((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] engine uuid is NULL");
}
if (NULL != key) {
temp->pitch = atoi((char*)key);
xmlFree(key);
+ key = NULL;
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Pitch is NULL");
}
config_info = NULL;
}
+ xmlCleanupParser();
+
return 0;
}
}
xmlFreeDoc(doc);
+ doc = NULL;
SLOG(LOG_DEBUG, tts_tag(), "[SUCCESS] Copying xml");
return 0;
default: xmlNodeSetContent(cur, (const xmlChar*)TTS_TAG_VOICE_TYPE_FEMALE); break;
}
}
-
+
cur = cur->next;
}
*engine = strdup((char*)key_new);
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
*setting = strdup((char*)key_new);
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
}
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
*language = strdup((char*)key_new);
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
}
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
*speech_rate = atoi((char*)key_new);
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");
*pitch = atoi((char*)key_new);
}
xmlFree(key_new);
+ key_new = NULL;
}
xmlFree(key_old);
+ key_old = NULL;
}
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] old config and new config are different");