Fix svace issues 78/90278/2 accepted/tizen/common/20160929.163831 accepted/tizen/ivi/20160929.235439 accepted/tizen/mobile/20160929.235356 accepted/tizen/tv/20160929.235409 accepted/tizen/wearable/20160929.235427 submit/tizen/20160929.103934
authorstom.hwang <stom.hwang@samsung.com>
Thu, 29 Sep 2016 08:43:06 +0000 (17:43 +0900)
committerstom.hwang <stom.hwang@samsung.com>
Thu, 29 Sep 2016 09:23:40 +0000 (18:23 +0900)
Change-Id: Ia87af054066b795bb1db7f70d1121cf6310e19fc
Signed-off-by: stom.hwang <stom.hwang@samsung.com>
common/tts_config_mgr.c [changed mode: 0644->0755]
common/tts_config_parser.c [changed mode: 0644->0755]
engine-parser/src/tts-engine-parser.c [changed mode: 0644->0755]
server/ttsd_server.c [changed mode: 0644->0755]
test/test_main.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index f764593..7794fe8
@@ -942,12 +942,16 @@ static int __tts_config_mgr_register_engine_config_updated_event(const char* pat
        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");
+               free(ino);
+               ino = NULL;
                return -1;
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 9de67eb..6df067b
@@ -137,7 +137,6 @@ int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info
 
                        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");
old mode 100644 (file)
new mode 100755 (executable)
index a9765a8..c5e2e27
@@ -131,7 +131,9 @@ static int __remove_engine_info_xml(const char *pkgid)
        snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid);
        if (0 == access(path, F_OK)) {
                LOGD("Remove engine info xml(%s)", path);
-               remove(path);
+               if (0 != remove(path)) {
+                       LOGE("[ERROR] Fail to Remove engine info xml(%s)", path);
+               }
        }
        LOGD("===");
        return 0;
old mode 100644 (file)
new mode 100755 (executable)
index 93fdbad..a65f2a5
@@ -375,9 +375,6 @@ void __config_changed_cb(tts_config_type_e type, const char* str_param, int int_
                }
                break;
        }
-
-       default:
-               break;
        }
 
        return;
old mode 100644 (file)
new mode 100755 (executable)
index 428a356..1bcb001
@@ -41,10 +41,14 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
                return 0;
        }
 
-       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);
-       if (0 >= text_len) {
+       if (0 >= text_len || 0 > text_len + 1) {
                SLOG(LOG_ERROR, tts_tag(), "File has no contents");
                fclose(fp);
                return 0;
@@ -53,7 +57,7 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
        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");