{
int ret;
sqlite3 *db;
- const char *dbpath;
+ char *dbpath;
if (lhs_package_id == NULL || rhs_package_id == NULL ||
compare_result == NULL) {
ret = sqlite3_open_v2(dbpath, &db, SQLITE_OPEN_READONLY, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to open db: %d", ret);
+ free(dbpath);
return PMINFO_R_ERROR;
}
+ free(dbpath);
if (_pkginfo_compare_certinfo(db, lhs_package_id, rhs_package_id,
compare_result)) {
"SELECT package FROM package_app_info WHERE app_id=?";
int ret;
sqlite3 *db;
- const char *dbpath;
+ char *dbpath;
sqlite3_stmt *stmt;
dbpath = getUserPkgParserDBPathUID(uid);
ret = sqlite3_open_v2(dbpath, &db, SQLITE_OPEN_READONLY, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to open db: %d", ret);
+ free(dbpath);
return PMINFO_R_ERROR;
}
+ free(dbpath);
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if (ret != SQLITE_OK) {
{
int ret;
sqlite3 *db;
- const char *dbpath;
+ char *dbpath;
/* open unified global cert db */
dbpath = getUserPkgCertDBPathUID(GLOBAL_USER);
ret = sqlite3_open_v2(dbpath, &db, SQLITE_OPEN_READONLY, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to open db: %d", ret);
+ free(dbpath);
return PMINFO_R_ERROR;
}
+ free(dbpath);
ret = _pkginfo_get_certid(db, pkgid, info->cert_id);
if (ret != PMINFO_R_OK) {
{
int ret;
sqlite3 *db;
- const char *dbpath;
+ char *dbpath;
pkgmgr_instcertinfo_x *info = (pkgmgr_instcertinfo_x *)handle;
if (pkgid == NULL || handle == NULL) {
ret = sqlite3_open_v2(dbpath, &db, SQLITE_OPEN_READWRITE, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to open db: %d", ret);
+ free(dbpath);
return PMINFO_R_ERROR;
}
+ free(dbpath);
ret = sqlite3_exec(db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
if (ret != SQLITE_OK) {
{
int ret;
sqlite3 *db;
- const char *dbpath;
+ char *dbpath;
if (pkgid == NULL) {
_LOGE("invalid parameter");
ret = sqlite3_open_v2(dbpath, &db, SQLITE_OPEN_READWRITE, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to open db: %d", ret);
+ free(dbpath);
return PMINFO_R_ERROR;
}
+ free(dbpath);
ret = sqlite3_exec(db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
if (ret != SQLITE_OK) {