0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-27 22:26:21 +00:00

Fix Valgrind errors ()

This commit is contained in:
Vladimir Kobal 2022-04-19 09:59:44 +02:00 committed by GitHub
parent fe3bea8a15
commit 72a5ec6e37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 2 deletions

View file

@ -23,6 +23,8 @@ void aclk_send_alarm_log_entry(struct alarm_log_entry *log_entry)
char *payload = generate_alarm_log_entry(&payload_size, log_entry);
aclk_send_bin_msg(payload, payload_size, ACLK_TOPICID_ALARM_LOG, "AlarmLogEntry");
freez(payload);
}
void aclk_send_provide_alarm_cfg(struct provide_alarm_configuration *cfg)

View file

@ -364,7 +364,7 @@ void aclk_stats_upd_online(int online) {
}
#ifdef NETDATA_INTERNAL_CHECKS
static usec_t pub_time[UINT16_MAX];
static usec_t pub_time[UINT16_MAX + 1] = {0};
void aclk_stats_msg_published(uint16_t id)
{
ACLK_STATS_LOCK;

View file

@ -176,8 +176,10 @@ char *generate_alarm_log_entry(size_t *len, struct alarm_log_entry *data)
*len = PROTO_COMPAT_MSG_SIZE(le);
char *bin = (char*)mallocz(*len);
if (!le.SerializeToArray(bin, *len))
if (!le.SerializeToArray(bin, *len)) {
freez(bin);
return NULL;
}
return bin;
}

View file

@ -84,6 +84,7 @@ void * wal_get_transaction_buffer(struct rrdengine_worker_config* wc, unsigned s
if (unlikely(ret)) {
fatal("posix_memalign:%s", strerror(ret));
}
memset(ctx->commit_log.buf, 0, buf_size);
buf_pos = ctx->commit_log.buf_pos = 0;
ctx->commit_log.buf_size = buf_size;
}

View file

@ -735,6 +735,7 @@ static int do_flush_pages(struct rrdengine_worker_config* wc, int force, struct
fatal("posix_memalign:%s", strerror(ret));
/* freez(xt_io_descr);*/
}
memset(xt_io_descr->buf, 0, ALIGN_BYTES_CEILING(size_bytes));
(void) memcpy(xt_io_descr->descr_array, eligible_pages, sizeof(struct rrdeng_page_descr *) * count);
xt_io_descr->descr_count = count;