/* It only needs list of ids, does not need to query sensitive info. So sending 0 */
GList *account_list_temp = _account_query_account_by_package_name(account_db_handle, package_name, &ret, pid, uid);
+
if (_account_db_err_code(account_db_handle) == SQLITE_PERM) {
ACCOUNT_ERROR("Access failed(%s)", _account_db_err_msg(account_db_handle));
return _ACCOUNT_ERROR_PERMISSION_DENIED;
if (_account_db_err_code(account_db_handle) == SQLITE_PERM) {
ACCOUNT_ERROR("Access failed(%s)", _account_db_err_msg(account_db_handle));
+ g_slist_free_full(account_id_list, g_free);
return _ACCOUNT_ERROR_PERMISSION_DENIED;
}
if (ret_transaction == _ACCOUNT_ERROR_DATABASE_BUSY) {
ACCOUNT_ERROR("database busy(%s)", _account_db_err_msg(account_db_handle));
+ g_slist_free_full(account_id_list, g_free);
return _ACCOUNT_ERROR_DATABASE_BUSY;
} else if (ret_transaction != _ACCOUNT_ERROR_NONE) {
ACCOUNT_ERROR("account_delete:_account_begin_transaction fail %d\n", ret_transaction);
+ g_slist_free_full(account_id_list, g_free);
return ret_transaction;
}
if (_account_db_err_code(account_db_handle) == SQLITE_PERM) {
_account_end_transaction(account_db_handle, false);
ACCOUNT_ERROR("Access failed(%s)", _account_db_err_msg(account_db_handle));
+ g_slist_free_full(account_id_list, g_free);
return _ACCOUNT_ERROR_PERMISSION_DENIED;
}
ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, _ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found.\n"));
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { _account_end_transaction(account_db_handle, false); }, rc, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE),
+ { _account_end_transaction(account_db_handle, false); g_slist_free_full(account_id_list, g_free); }, rc, ("finalize error"));
hstmt = NULL;
_INFO("start delete capability table");
ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, _ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found.\n"));
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { _account_end_transaction(account_db_handle, false); }, rc, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE),
+ { _account_end_transaction(account_db_handle, false); g_slist_free_full(account_id_list, g_free); }, rc, ("finalize error"));
hstmt = NULL;
_INFO("start delete account table");
ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, _ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found. package_name=%s, rc=%d\n", package_name, rc));
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { _account_end_transaction(account_db_handle, false); }, rc, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE),
+ { _account_end_transaction(account_db_handle, false); g_slist_free_full(account_id_list, g_free); }, rc, ("finalize error"));
is_success = TRUE;
hstmt = NULL;
CATCH:
if (hstmt != NULL) {
rc = _account_query_finalize(hstmt);
- ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE), { _account_end_transaction(account_db_handle, false); }, rc, ("finalize error"));
+ ACCOUNT_RETURN_VAL((rc == _ACCOUNT_ERROR_NONE),
+ { _account_end_transaction(account_db_handle, false); g_slist_free_full(account_id_list, g_free); }, rc, ("finalize error"));
hstmt = NULL;
}