Close db when sqlite3_prepare_v2 is failed
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgrinfo_updateinfo.c
index f7dc389..e796885 100644 (file)
@@ -238,6 +238,7 @@ static int _get_pkg_updateinfo_from_db(const char *pkgid,
        if (ret != SQLITE_OK) {
                _LOGE("Don't execute query = %s error message = %s\n", query,
                sqlite3_errmsg(db));
+               sqlite3_close_v2(db);
                free(dbpath);
                return -1;
        }