/*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/* alloc engine info */
tts_engine_info_s* temp;
temp = (tts_engine_info_s*)calloc(1, sizeof(tts_engine_info_s));
+ if (NULL == temp) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory");
+ xmlFreeDoc(doc);
+ return -1;
+ }
temp->name = NULL;
temp->uuid = NULL;
if (0 == xmlStrcmp(voice_node->name, (const xmlChar *)TTS_TAG_ENGINE_VOICE)) {
tts_config_voice_s* temp_voice = (tts_config_voice_s*)calloc(1, sizeof(tts_config_voice_s));
+ if (NULL == temp_voice) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory");
+ break;
+ }
attr = xmlGetProp(voice_node, (const xmlChar*)TTS_TAG_ENGINE_VOICE_TYPE);
if (NULL != attr) {
if (NULL != temp_voice->language) free(temp_voice->language);
temp_voice->language = strdup((char*)key);
xmlFree(key);
+ temp->voices = g_slist_append(temp->voices, temp_voice);
} else {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_VOICE);
+ if (NULL != temp_voice) {
+ free(temp_voice);
+ }
}
-
- temp->voices = g_slist_append(temp->voices, temp_voice);
}
voice_node = voice_node->next;
}
break;
}
retry_count++;
- usleep(1000);
+ usleep(10000);
- if (100 == retry_count) {
+ if (TTS_RETRY_COUNT == retry_count) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", TTS_CONFIG);
return -1;
}
/* alloc engine info */
tts_config_s* temp;
temp = (tts_config_s*)calloc(1, sizeof(tts_config_s));
+ if (NULL == temp) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory");
+ xmlFreeDoc(doc);
+ return -1;
+ }
temp->engine_id = NULL;
temp->setting = NULL;
break;
}
retry_count++;
- usleep(1000);
+ usleep(10000);
- if (100 == retry_count) {
+ if (TTS_RETRY_COUNT == retry_count) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", TTS_CONFIG);
return -1;
}