summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Vijay <abhishek.v@samsung.com>2021-05-31 18:25:20 +0530
committerAbhishek Vijay <abhishek.v@samsung.com>2021-05-31 18:28:35 +0530
commita366e4bc8be1b39b2ce00b3d0bc480e875b1d62c (patch)
tree607b7d8bc39b836cb77ba0917326f21dabf820dc
parent91d47c2f4d9f277cc59c6a2712a12ed246fc0960 (diff)
downloadaccount-common-accepted/tizen_8.0_unified.tar.gz
account-common-accepted/tizen_8.0_unified.tar.bz2
account-common-accepted/tizen_8.0_unified.zip
Change-Id: Icfa764547900dd479be66b30d001f2e82ce6691c Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
-rw-r--r--common/src/account_db_helper.c54
1 files changed, 46 insertions, 8 deletions
diff --git a/common/src/account_db_helper.c b/common/src/account_db_helper.c
index c05fd42..a89a628 100644
--- a/common/src/account_db_helper.c
+++ b/common/src/account_db_helper.c
@@ -1016,10 +1016,29 @@ int _account_get_represented_appid_from_db(sqlite3 *account_user_db, sqlite3 *ac
/* Get app id family which is stored in account database */
_account_get_appid_from_db(&ahandle, &phandle, &package_id, appid, uid, &appid_list);
- ACCOUNT_RETURN_VAL((ahandle != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("appinfo handle is NULL"));
- ACCOUNT_RETURN_VAL((phandle != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("pkginfo handle is NULL"));
- ACCOUNT_RETURN_VAL((package_id != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("package_id is NULL"));
- ACCOUNT_RETURN_VAL((appid_list != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("appid_list is NULL"));
+ ACCOUNT_RETURN_VAL((ahandle != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (package_id) free(package_id);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("appinfo handle is NULL"));
+
+ ACCOUNT_RETURN_VAL((phandle != NULL), {
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (package_id) free(package_id);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("pkginfo handle is NULL"));
+
+ ACCOUNT_RETURN_VAL((package_id != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("package_id is NULL"));
+
+ ACCOUNT_RETURN_VAL((appid_list != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (package_id) free(package_id);
+ }, _ACCOUNT_ERROR_NO_DATA, ("appid_list is NULL"));
/* Compare current app id with the stored app id family */
for (iter = appid_list; iter != NULL; iter = g_slist_next(iter)) {
@@ -1077,10 +1096,29 @@ int _account_check_appid_group_with_package_name(const char *appid, char *packag
/* Get app id family which is stored in account database */
_account_get_appid_from_db(&ahandle, &phandle, &package_id, appid, uid, &appid_list);
- ACCOUNT_RETURN_VAL((ahandle != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("appinfo handle is NULL"));
- ACCOUNT_RETURN_VAL((phandle != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("pkginfo handle is NULL"));
- ACCOUNT_RETURN_VAL((package_id != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("package_id is NULL"));
- ACCOUNT_RETURN_VAL((appid_list != NULL), {}, _ACCOUNT_ERROR_NO_DATA, ("appid_list is NULL"));
+ ACCOUNT_RETURN_VAL((ahandle != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (package_id) free(package_id);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("appinfo handle is NULL"));
+
+ ACCOUNT_RETURN_VAL((phandle != NULL), {
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (package_id) free(package_id);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("pkginfo handle is NULL"));
+
+ ACCOUNT_RETURN_VAL((package_id != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (appid_list) g_slist_free(appid_list);
+ }, _ACCOUNT_ERROR_NO_DATA, ("package_id is NULL"));
+
+ ACCOUNT_RETURN_VAL((appid_list != NULL), {
+ if (phandle) pkgmgrinfo_pkginfo_destroy_pkginfo(phandle);
+ if (ahandle) pkgmgrinfo_appinfo_destroy_appinfo(ahandle);
+ if (package_id) free(package_id);
+ }, _ACCOUNT_ERROR_NO_DATA, ("appid_list is NULL"));
/* Compare current app id with the stored app id family */
for (iter = appid_list; iter != NULL; iter = g_slist_next(iter)) {