Change-Id: Ia87af054066b795bb1db7f70d1121cf6310e19fc
Signed-off-by: stom.hwang <stom.hwang@samsung.com>
SLOG(LOG_DEBUG, tts_tag(), "Add inotify watch(%s)", path);
if (ino->dir_wd < 0) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add watch");
SLOG(LOG_DEBUG, tts_tag(), "Add inotify watch(%s)", path);
if (ino->dir_wd < 0) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add watch");
+ free(ino);
+ ino = NULL;
return -1;
}
ino->dir_fd_handler = ecore_main_fd_handler_add(ino->dir_fd, ECORE_FD_READ, (Ecore_Fd_Cb)__tts_config_mgr_engine_config_inotify_event_callback, (void *)ino, NULL, NULL);
if (NULL == ino->dir_fd_handler) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add fd handler");
return -1;
}
ino->dir_fd_handler = ecore_main_fd_handler_add(ino->dir_fd, ECORE_FD_READ, (Ecore_Fd_Cb)__tts_config_mgr_engine_config_inotify_event_callback, (void *)ino, NULL, NULL);
if (NULL == ino->dir_fd_handler) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add fd handler");
+ free(ino);
+ ino = NULL;
while (NULL != voice_node) {
if (0 == xmlStrcmp(voice_node->name, (const xmlChar *)TTS_TAG_ENGINE_VOICE)) {
while (NULL != voice_node) {
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");
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");
snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid);
if (0 == access(path, F_OK)) {
LOGD("Remove engine info xml(%s)", path);
snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid);
if (0 == access(path, F_OK)) {
LOGD("Remove engine info xml(%s)", path);
+ if (0 != remove(path)) {
+ LOGE("[ERROR] Fail to Remove engine info xml(%s)", path);
+ }
- fseek(fp , 0 , SEEK_END);
+ if (0 != fseek(fp , 0 , SEEK_END)) {
+ SLOG(LOG_ERROR, tts_tag(), "Fail to fseek()");
+ fclose(fp);
+ return 0;
+ }
int text_len = ftell(fp);
int text_len = ftell(fp);
+ if (0 >= text_len || 0 > text_len + 1) {
SLOG(LOG_ERROR, tts_tag(), "File has no contents");
fclose(fp);
return 0;
SLOG(LOG_ERROR, tts_tag(), "File has no contents");
fclose(fp);
return 0;
rewind(fp);
char* temp = NULL;
rewind(fp);
char* temp = NULL;
- temp = (char*)calloc(1, text_len+1);
+ temp = (char*)calloc(1, text_len + 1);
if (temp == NULL) {
SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation");
if (temp == NULL) {
SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation");