Remove unnecessary null check 62/238862/2
authorhyunho <hhstark.kang@samsung.com>
Mon, 20 Jul 2020 02:08:27 +0000 (11:08 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 20 Jul 2020 02:44:25 +0000 (11:44 +0900)
- Static analyzer issue

Change-Id: Iff9f561d1598d16505679f38557149fbb493cde3
Signed-off-by: hyunho <hhstark.kang@samsung.com>
src/widget_service.c

index 529aa22..43edf75 100644 (file)
@@ -405,7 +405,7 @@ static int _check_db_integrity(uid_t uid, bool is_init)
 {
        int ret;
        const char *path;
-       sqlite3 *db = NULL;
+       sqlite3 *db;
 
        path = _get_db_path(uid, is_init);
        if (path == NULL)
@@ -435,9 +435,7 @@ static int _check_db_integrity(uid_t uid, bool is_init)
                ret = _recover_db(db, path, uid, is_init);
                return ret;
        }
-
-       if (db)
-               sqlite3_close(db);
+       sqlite3_close(db);
 
        return WIDGET_ERROR_NONE;
 }