} while (rc == SQLITE_ROW);
handle_error:
- sqlite3_reset(stmt);
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
-stc_error_e table_restrictions_foreach(const table_restrictions_info_cb restriction_cb,
+API stc_error_e table_restrictions_foreach(const table_restrictions_info_cb restriction_cb,
void *user_data)
{
__STC_LOG_FUNC_ENTER__;
}
} while (rc == SQLITE_ROW);
- sqlite3_reset(stmt);
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
}
*type = STC_RSTN_TYPE_UNKNOWN;
- sqlite3_reset(select_restriction_type_subscriber_id);
- sqlite3_reset(select_restriction_type);
+ ret = sqlite3_reset(select_restriction_type_subscriber_id);
+ if (ret != SQLITE_OK) {
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ }
+
+ ret = sqlite3_reset(select_restriction_type);
+ if (ret != SQLITE_OK) {
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ }
if (subscriber_id == NULL) {
state_subscriber_id = 0;
}
handle_error:
- sqlite3_reset(select_restriction_type);
- sqlite3_reset(select_restriction_type_subscriber_id);
+ ret = sqlite3_reset(select_restriction_type);
+ if (ret != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
+ ret = sqlite3_reset(select_restriction_type_subscriber_id);
+ if (ret != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}
handle_error:
- sqlite3_reset(stmt);
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}
default:
STC_LOGE("Failed to get restriction id: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
handle_error:
- sqlite3_reset(stmt);
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
goto handle_error; //LCOV_EXCL_LINE
}
- __get_restriction_id(info);
+ if (__get_restriction_id(info) != STC_ERROR_NONE) {
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
+ }
+
if (info->restriction_id)
stmt = update_net_restrictions;
STC_LOGD("Restriction updated app_id [%s]", info->app_id);
} else {
STC_LOGD("Restriction inserted app_id [%s]", info->app_id);
- __get_restriction_id(info);
+ if (__get_restriction_id(info) != STC_ERROR_NONE)
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
}
handle_error:
- sqlite3_reset(stmt);
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}