From 1b55fd5b6d37828417be9c8c4bb5a4f176bf7bbd Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Fri, 18 Dec 2015 16:50:07 +0900 Subject: [PATCH] fix SVACE issue due to handle leak Change-Id: Ia9bb6b5cfd60b558bca726a08bf9f720115388b4 Signed-off-by: Wonnam Jang --- test/test_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_main.c b/test/test_main.c index 944f2f6..c39a146 100644 --- a/test/test_main.c +++ b/test/test_main.c @@ -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; } } -- 2.7.4