@cryptotaxi247 / netdata-1 / commits / 46bdf0b4c

Fix coverity issue 378617,378615 (#13021)

* Fix CID 378617 * Fix CID 378615 * Make sure the ST rrdr lock indicator is set/reset while holding a lock * Switch to int

Stelios Fragkakis committed May 31, 2022 at 09:19 UTC 46bdf0b4ceac28866c4345cf972c326b7a2f845e
2 files changed +3 -3
aclk/aclk_query.c
+2 -2
@@ -112,9 +112,9 @@ static int http_api_v2(struct aclk_query_thread *query_thr, aclk_query_t query)
112 now_realtime_timeval(&w->tv_ready);
113
114 if (query->timeout) {
115 - double in_queue = (int)dt_usec(&w->tv_in, &w->tv_ready) / 1000;
115 + int in_queue = (int) (dt_usec(&w->tv_in, &w->tv_ready) / 1000);
116 if (in_queue > query->timeout) {
117 - log_access("QUERY CANCELED: QUEUE TIME EXCEEDED %0.2f ms (LIMIT %d ms)", in_queue, query->timeout);
117 + log_access("QUERY CANCELED: QUEUE TIME EXCEEDED %d ms (LIMIT %d ms)", in_queue, query->timeout);
118 retval = 1;
119 w->response.code = HTTP_RESP_BACKEND_FETCH_FAILED;
120 aclk_http_msg_v2_err(query_thr->client, query->callback_topic, query->msg_id, w->response.code, CLOUD_EC_SND_TIMEOUT, CLOUD_EMSG_SND_TIMEOUT, NULL, 0);
web/api/queries/rrdr.c
+1 -1
@@ -78,8 +78,8 @@ inline static void rrdr_unlock_rrdset(RRDR *r) {
78 }
79
80 if(likely(r->has_st_lock)) {
81 - rrdset_unlock(r->st);
81 r->has_st_lock = 0;
82 + rrdset_unlock(r->st);
83 }
84 }
85