From 9d5407709a6b133124432087f8d81f8a08282af7 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 31 Mar 2020 20:40:26 +0900 Subject: [PATCH] Fix issues detected by static analysis tool Change-Id: I19d0a8dd76c0b4f9e58ce1541a995ca6a2e3f020 Signed-off-by: Jihoon Kim --- server/stickerd_db_manager.c | 2 ++ sticker-parser/sticker-parser.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/stickerd_db_manager.c b/server/stickerd_db_manager.c index dbefbb7..3adda1b 100644 --- a/server/stickerd_db_manager.c +++ b/server/stickerd_db_manager.c @@ -188,6 +188,7 @@ static int _recover_db(void) if (ret != SQLITE_OK) { LOGE("Failed to create sticker_keyword_info table : %s", err); ret = STICKERD_SERVER_ERROR_DB_FAILED; + goto cleanup; } ret = sqlite3_exec(db, STICKER_WHITELIST_INFO_CREATE_TABLE, NULL, NULL, &err); @@ -251,6 +252,7 @@ int stickerd_db_init(void) if (ret != SQLITE_OK) { LOGE("Failed to create sticker_whitelist_info table : %s", err); ret = STICKERD_SERVER_ERROR_DB_FAILED; + goto cleanup; } ret = sqlite3_exec(db, "PRAGMA journal_mode = WAL", NULL, NULL, &err); diff --git a/sticker-parser/sticker-parser.c b/sticker-parser/sticker-parser.c index d5a3bd4..2c3eb73 100644 --- a/sticker-parser/sticker-parser.c +++ b/sticker-parser/sticker-parser.c @@ -599,8 +599,10 @@ static int __get_sticker_info_from_json(const char *appid, const char *file_path goto free_memory; thumbnail = __get_string_from_object(info_object, "thumbnail"); - if (thumbnail) + if (thumbnail) { + free(thumbnail); thumbnail = __convert_sticker_uri(thumbnail, appid, app_path); + } description = __get_string_from_object(info_object, "description"); int disp_type = __get_int_from_object(info_object, "display_type"); -- 2.7.4