syslocale = vconf_get_str(VCONFKEY_LANGSET);
if (syslocale == NULL) {
_LOGE("current locale is NULL\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ return PMINFO_R_ERROR;
}
locale = __convert_system_locale_to_manifest_locale(syslocale);
if (locale == NULL) {
_LOGE("manifest locale is NULL\n");
- ret = PMINFO_R_EINVAL;
- goto err;
+ free(syslocale);
+ return PMINFO_R_ERROR;
}
ret = __open_manifest_db(uid);
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
}
pkgmgr_pkginfo_x *tmphead = (pkgmgr_pkginfo_x *)calloc(1, sizeof(pkgmgr_pkginfo_x));
pkgmgr_pkginfo_x *node = NULL;
ret = __open_manifest_db(uid);
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
}
/*Start constructing query*/
ret = __open_manifest_db(uid);
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
}
/*Start constructing query*/
snprintf(query, MAX_QUERY_LEN - 1, FILTER_QUERY_LIST_PACKAGE, locale);
_LOGE("Don't execute query = %s error message = %s\n", query,
error_message);
sqlite3_free(error_message);
- sqlite3_close(manifest_db);
ret = PMINFO_R_ERROR;
goto err;
}
ret = __open_manifest_db(uid);
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
}
/*Start constructing query*/
ret = __open_manifest_db(uid);
if (ret == -1) {
_LOGE("Fail to open manifest DB\n");
- ret = PMINFO_R_ERROR;
- goto err;
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
}
/*Start constructing query*/
snprintf(query, MAX_QUERY_LEN - 1, FILTER_QUERY_LIST_APP, locale);
tryvm_if(locale == NULL, ret = PMINFO_R_ERROR, "manifest locale is NULL\n");
ret = __open_manifest_db(uid);
- tryvm_if(ret == -1, ret = PMINFO_R_ERROR, "Fail to open manifest DB\n");
-
+ if (ret == -1) {
+ _LOGE("Fail to open manifest DB\n");
+ free(syslocale);
+ free(locale);
+ return PMINFO_R_ERROR;
+ }
/*Start constructing query*/
memset(where, '\0', MAX_QUERY_LEN);
memset(query, '\0', MAX_QUERY_LEN);
char query[MAX_QUERY_LEN] = {'\0'};
ret = __open_manifest_db(uid);
- if (access(getUserPkgParserDBPathUID(uid), F_OK) == 0) {
- ret = db_util_open(MANIFEST_DB, &manifest_db,
- DB_UTIL_REGISTER_HOOK_METHOD);
- if (ret != SQLITE_OK) {
- _LOGE("connect db [%s] failed! Manifest DB does not exists!!\n", getUserPkgParserDBPathUID(uid));
- return PMINFO_R_ERROR;
- }
- }
-
/*Begin transaction*/
ret = sqlite3_exec(manifest_db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);
if (ret != SQLITE_OK) {
char *error_message = NULL;
ret = __open_manifest_db(uid);
- if (access(getUserPkgParserDBPathUID(uid), F_OK) == 0) {
- ret = db_util_open(getUserPkgParserDBPathUID(uid), &manifest_db,
- DB_UTIL_REGISTER_HOOK_METHOD);
- if (ret != SQLITE_OK) {
- _LOGE("connect db [%s] failed! Manifest DB does not exists!!\n", getUserPkgParserDBPathUID(uid));
- return PMINFO_R_ERROR;
- }
- }
/*Begin transaction*/
ret = sqlite3_exec(manifest_db, "BEGIN EXCLUSIVE", NULL, NULL, NULL);