/* 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)) {
/* 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)) {