fix SVACE issue due to handle leak 55/54855/1 accepted/tizen/mobile/20151219.044018 accepted/tizen/tv/20151219.044448 accepted/tizen/wearable/20151219.044724 submit/tizen/20151218.084220 submit/tizen_common/20151229.142028 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
authorWonnam Jang <wn.jang@samsung.com>
Fri, 18 Dec 2015 07:50:07 +0000 (16:50 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Fri, 18 Dec 2015 07:50:07 +0000 (16:50 +0900)
Change-Id: Ia9bb6b5cfd60b558bca726a08bf9f720115388b4
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
test/test_main.c

index 944f2f6..c39a146 100644 (file)
@@ -55,7 +55,8 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
        *text = (char*)calloc(1, text_len+1);
 
        if (text == NULL) {
-               SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation\n");              
+               SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation\n");
+               fclose(fp);
                return 0;
        }
        
@@ -64,6 +65,7 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
                result_len = fread(*text, sizeof(char), text_len, fp);
                if (result_len != text_len) {
                        SLOG(LOG_ERROR, tts_tag(), "Fail to read\n");
+                       fclose(fp);
                        return 0;
                }
        }