diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-06-09 15:15:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 15:15:39 +0300 |
commit | 4d0f2b5ef322e3da3a0182acb47780f002fbd4cc (patch) | |
tree | 195573d3ff38e12a4e0d0cf94125cc42ae6f9956 /streaming/sender.c | |
parent | f34df65da3fbad346833c924186d2aad5e025248 (diff) |
Fix coverity issues (#15169)
* online is true at this point
* ignore return value
* Check sender existence
Diffstat (limited to 'streaming/sender.c')
-rw-r--r-- | streaming/sender.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/streaming/sender.c b/streaming/sender.c index b207039b5e..bcdc4f373d 100644 --- a/streaming/sender.c +++ b/streaming/sender.c @@ -1101,7 +1101,7 @@ void rrdpush_signal_sender_to_wake_up(struct sender_state *s) { static NETDATA_DOUBLE rrdhost_sender_replication_completion(RRDHOST *host, time_t now, size_t *instances) { size_t charts = rrdhost_sender_replicating_charts(host); NETDATA_DOUBLE completion; - if(!charts || !host->sender->replication.oldest_request_after_t) + if(!charts || !host->sender || !host->sender->replication.oldest_request_after_t) completion = 100.0; else if(!host->sender->replication.latest_completed_before_t || host->sender->replication.latest_completed_before_t < host->sender->replication.oldest_request_after_t) completion = 0.0; @@ -1159,8 +1159,7 @@ void rrdhost_sender_to_json(BUFFER *wb, RRDHOST *host, const char *key, time_t n snprintfz(buf, 1024, "[%s]:%d%s", peers.peer.ip, peers.peer.port, ssl ? ":SSL" : ""); buffer_json_member_add_string(wb, "remote", buf); - stream_capabilities_to_json_array(wb, online ? host->sender->capabilities : 0, - "capabilities"); + stream_capabilities_to_json_array(wb, host->sender->capabilities, "capabilities"); buffer_json_member_add_object(wb, "traffic"); { |