Fix a issue of static analysis 64/125564/3
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 18 Apr 2017 04:51:02 +0000 (13:51 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Wed, 19 Apr 2017 01:56:35 +0000 (18:56 -0700)
Change-Id: I386ddff7fd06752e43191c96b6931d55157c9fd7
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkgmgrinfo_pkginfo.c

index ae1073c..b5cac35 100644 (file)
@@ -376,7 +376,7 @@ static int _pkginfo_get_packages(uid_t uid, const char *locale,
        author_x *author = NULL;
        GList *bind_params = NULL;
        sqlite3 *db;
-       sqlite3_stmt *stmt;
+       sqlite3_stmt *stmt = NULL;
        pkgmgrinfo_filter_x *tmp_filter = NULL;
        bool is_check_storage = true;
 
@@ -570,7 +570,8 @@ catch:
 
        g_list_free_full(bind_params, free);
        sqlite3_close_v2(db);
-       sqlite3_finalize(stmt);
+       if (stmt)
+               sqlite3_finalize(stmt);
 
        return ret;
 }