From 8da1109ec9a262c3417fcc6aa55d8b888d375c9d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 11 Jan 2013 11:52:14 +0100 Subject: [PATCH] riemann plugin: Fix two minor bugs. --- src/riemann.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/riemann.c b/src/riemann.c index 12f99535..315a52db 100644 --- a/src/riemann.c +++ b/src/riemann.c @@ -333,7 +333,7 @@ static Event *riemann_value_to_protobuf (struct riemann_host const *host, /* {{{ /* TODO: Use FORMAT_VL() here. */ ssnprintf (service_buffer, sizeof(service_buffer), "%s-%s-%s-%s-%s", vl->plugin, vl->plugin_instance, - vl->type, vl->type_instance, ds->ds[i].name); + vl->type, vl->type_instance, ds->ds[index].name); event->service = strdup (service_buffer); DEBUG ("riemann plugin: Successfully created protobuf for metric: " @@ -373,7 +373,7 @@ static Msg *riemann_value_list_to_protobuf (struct riemann_host const *host, /* { msg->events[i] = riemann_value_to_protobuf (host, ds, vl, (int) i, /* rates = */ NULL); - if (msg->events[i]) + if (msg->events[i] == NULL) { riemann_msg_protobuf_free (msg); return (NULL); -- 2.30.2