free prepared statements 23/271023/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.062311 accepted/tizen/7.0/unified/hotfix/20221116.104536 accepted/tizen/8.0/unified/20231005.092551 accepted/tizen/unified/20220221.224809 submit/tizen/20220221.063346 tizen_7.0_m2_release tizen_8.0_m2_release
authorDewal Agarwal <d1.agarwal@samsung.com>
Mon, 14 Feb 2022 08:33:44 +0000 (14:03 +0530)
committerDewal Agarwal <d1.agarwal@samsung.com>
Mon, 14 Feb 2022 08:33:44 +0000 (14:03 +0530)
Change-Id: I62de29f562ebe8dbc0de7fd24fb25635247cf276
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
server/src/account-server-db.c

index bf61430..a968ac2 100644 (file)
@@ -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;
        }