Fix double close issue 28/269328/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 12 Jan 2022 01:50:34 +0000 (10:50 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 13 Jan 2022 01:02:58 +0000 (10:02 +0900)
Handler 'db' is passed to a function at sticker-parser.c:884 by calling function 'sqlite3_close' after the handler is closed again at sticker-parser.c:861 by calling function 'sqlite3_close'.

Handler 'stmt' is passed to a function at sticker-parser.c:842 by calling function 'sqlite3_finalize' after the handler is closed again at sticker-parser.c:819 by calling function 'sqlite3_finalize'.

Change-Id: I969482a8713925dcf4539d70717f132d74cf987b
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
sticker-parser/sticker-parser.c

index 71b7a0d..cab6058 100644 (file)
@@ -753,8 +753,6 @@ static void __delete_sticker_allowlist(const char *db_path, const char *app_id)
     ret = sqlite3_prepare_v2(db, "DELETE FROM sticker_whitelist_info WHERE provider_id = ?", -1, &stmt, NULL);
     if (ret != SQLITE_OK) {
         LOGE("failed to delete sticker allowlist : %s", sqlite3_errmsg(db));
-        sqlite3_finalize(stmt);
-        sqlite3_close(db);
         goto cleanup;
     }
 
@@ -794,8 +792,6 @@ static void __delete_sticker_info(const char *db_path, int record_id)
     ret = sqlite3_prepare_v2(db, "DELETE FROM sticker_info WHERE sticker_info_id = ?", -1, &stmt, NULL);
     if (ret != SQLITE_OK) {
         LOGE("failed to delete sticker information : %s", sqlite3_errmsg(db));
-        sqlite3_finalize(stmt);
-        sqlite3_close(db);
         goto cleanup;
     }
 
@@ -1044,4 +1040,4 @@ int PKGMGR_CATEGORY_PARSER_PLUGIN_UPGRADE(const char *pkgid, const char *appid,
     PKGMGR_CATEGORY_PARSER_PLUGIN_INSTALL(pkgid, appid, list);
 
     return 0;
-}
\ No newline at end of file
+}