From: Dewal Agarwal Date: Mon, 14 Feb 2022 08:33:44 +0000 (+0530) Subject: free prepared statements X-Git-Tag: submit/tizen/20220221.063346^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_8.0;p=platform%2Fcore%2Faccount%2Faccount-manager.git free prepared statements Change-Id: I62de29f562ebe8dbc0de7fd24fb25635247cf276 Signed-off-by: Dewal Agarwal --- diff --git a/server/src/account-server-db.c b/server/src/account-server-db.c index bf61430..a968ac2 100644 --- a/server/src/account-server-db.c +++ b/server/src/account-server-db.c @@ -571,6 +571,8 @@ static int _account_update_capability(account_s *account, int account_id) if (rc != SQLITE_DONE) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DB_FAILED; } rc = _account_query_finalize(hstmt); @@ -652,6 +654,8 @@ static int _account_update_capability_by_user_name(account_s *account, const cha rc = _account_query_step(hstmt); if (rc != SQLITE_DONE) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DB_FAILED; } @@ -3222,6 +3226,8 @@ static int _account_type_update_provider_feature(sqlite3 *account_db_handle, acc if (rc != SQLITE_DONE) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(account_db_handle)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DB_FAILED; } rc = _account_query_finalize(hstmt); @@ -3290,6 +3296,8 @@ static int _account_type_update_label(sqlite3 *account_db_handle, account_type_s if (rc != SQLITE_DONE) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(account_db_handle)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DB_FAILED; } rc = _account_query_finalize(hstmt); @@ -4529,9 +4537,13 @@ static int _account_update_custom(account_s *account, int account_id) if (rc == SQLITE_BUSY) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DATABASE_BUSY; } else if (rc != SQLITE_DONE) { ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB)); + if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE) + _ERR("finalize error - account_query_step() failed"); return _ACCOUNT_ERROR_DB_FAILED; }