summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJooseok Song <seogii.song@samsung.com>2017-02-21 14:48:14 +0900
committerJooseok Song <seogii.song@samsung.com>2017-02-21 14:48:14 +0900
commit98bda9f7cfcba48e30164be761ed61ff4e29f500 (patch)
tree50373b7b7a5ee1fcf0e341e9e7c05b9f6cd7ffca
parentdbdcc158cad35e426829c1b977df7425e0cc0c8b (diff)
downloadaccount-manager-98bda9f7cfcba48e30164be761ed61ff4e29f500.tar.gz
account-manager-98bda9f7cfcba48e30164be761ed61ff4e29f500.tar.bz2
account-manager-98bda9f7cfcba48e30164be761ed61ff4e29f500.zip
Change-Id: Ib969212bed1c64f391834caf5b256ff829ff1cc4
-rw-r--r--packaging/account-manager.spec2
-rw-r--r--server/src/account-server-db.c32
2 files changed, 25 insertions, 9 deletions
diff --git a/packaging/account-manager.spec b/packaging/account-manager.spec
index 628dead..5d67b0e 100644
--- a/packaging/account-manager.spec
+++ b/packaging/account-manager.spec
@@ -1,6 +1,6 @@
Name: account-manager
Summary: Account Manager
-Version: 0.1.13
+Version: 0.1.14
Release: 1
Group: Social & Content/Other
License: Apache-2.0
diff --git a/server/src/account-server-db.c b/server/src/account-server-db.c
index a288777..2510ba4 100644
--- a/server/src/account-server-db.c
+++ b/server/src/account-server-db.c
@@ -1184,7 +1184,13 @@ GSList* _account_get_capability_list_by_account_id(int account_id, int *error_co
}
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { *error_code = rc; }, NULL, ("finalize error"));
+ if (rc != _ACCOUNT_ERROR_NONE) {
+ _ERR("finalize error");
+ _account_gslist_capability_free(capability_list);
+ *error_code = rc;
+ return NULL;
+ }
+
hstmt = NULL;
*error_code = _ACCOUNT_ERROR_NONE;
@@ -1748,7 +1754,7 @@ GSList* _account_db_query_all(int pid, uid_t uid)
}
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {}, NULL, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {_account_gslist_account_free(account_list); }, NULL, ("finalize error"));
hstmt = NULL;
GSList* iter;
@@ -3456,7 +3462,7 @@ GSList* _account_type_get_label_list_by_app_id_from_global_db(const char* app_id
GSList* label_list = NULL;
ACCOUNT_RETURN_VAL((app_id != NULL), { *error_code = _ACCOUNT_ERROR_INVALID_PARAMETER; }, NULL, ("APP ID IS NULL"));
- ACCOUNT_RETURN_VAL((g_hAccountGlobalDB != NULL), { *error_code = _ACCOUNT_ERROR_DB_NOT_OPENED; }, NULL, ("The database isn't connected."));
+ ACCOUNT_RETURN_VAL((g_hAccountGlobalDB != NULL), {}, _ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected."));
ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
@@ -3558,7 +3564,12 @@ GSList* _account_type_get_label_list_by_app_id(const char* app_id, int *error_co
}
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { *error_code = rc; }, NULL, ("finalize error"));
+ if (rc != _ACCOUNT_ERROR_NONE) {
+ _account_type_gslist_label_free(label_list);
+ *error_code = rc;
+ _ERR("finalize error");
+ return NULL;
+ }
hstmt = NULL;
*error_code = _ACCOUNT_ERROR_NONE;
@@ -3566,7 +3577,12 @@ GSList* _account_type_get_label_list_by_app_id(const char* app_id, int *error_co
CATCH:
if (hstmt != NULL) {
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { *error_code = rc; }, NULL, ("finalize error"));
+ if (rc != _ACCOUNT_ERROR_NONE) {
+ _account_type_gslist_label_free(label_list);
+ *error_code = rc;
+ _ERR("finalize error");
+ return NULL;
+ }
hstmt = NULL;
}
@@ -4115,7 +4131,7 @@ int _account_type_query_all_from_global_db(GSList **account_type_list_all)
GSList *account_type_list = NULL;
_INFO("_account_type_query_all_in_global_db start");
- ACCOUNT_RETURN_VAL((g_hAccountGlobalDB != NULL), {}, _ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected."));
+ ACCOUNT_RETURN_VAL((g_hAccountGlobalDB != NULL), {}, NULL, ("The database isn't connected."));
ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
@@ -4152,7 +4168,7 @@ int _account_type_query_all_from_global_db(GSList **account_type_list_all)
}
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {_account_type_gslist_account_type_free(account_type_list); }, rc, ("finalize error"));
hstmt = NULL;
GSList* iter;
@@ -4231,7 +4247,7 @@ GSList* _account_type_query_all(void)
}
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {}, NULL, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), {_account_type_gslist_account_type_free(account_type_list); }, NULL, ("finalize error"));
hstmt = NULL;
GSList* iter;