From: Florian Forster Date: Mon, 29 Jun 2015 10:52:03 +0000 (+0200) Subject: write_riemann plugin: Ensure that "statuses" is always initialized. X-Git-Tag: collectd-5.6.0~661 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cf8bb3fbdadcdd4ed021377a01da8fb6459b7e7e;p=collectd.git write_riemann plugin: Ensure that "statuses" is always initialized. Hopefully fixes "Uninitialized argument value" warning. --- diff --git a/src/write_riemann.c b/src/write_riemann.c index a67f94cc..26fa3f45 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -619,7 +619,7 @@ static Msg *riemann_value_list_to_protobuf (struct riemann_host const *host, /* msg__init (msg); /* Set up events. First, the list of pointers. */ - msg->n_events = (size_t) vl->values_len; + msg->n_events = vl->values_len; msg->events = calloc (msg->n_events, sizeof (*msg->events)); if (msg->events == NULL) { @@ -789,6 +789,8 @@ static int riemann_write(const data_set_t *ds, /* {{{ */ status = write_riemann_threshold_check(ds, vl, statuses); if (status != 0) return status; + } else { + memset (statuses, 0, sizeof (statuses)); } if (host->use_tcp == 1 && host->batch_mode) {