Code

Merge branch 'collectd-5.3'
[collectd.git] / src / write_riemann.c
index 3e2ddd75b0d5caec3bbc40b5121b1de20ab819b4..3345d0444a94653a4e3be42a9d9051bfd264e790 100644 (file)
@@ -60,6 +60,8 @@ static size_t   riemann_tags_num;
 
 static void riemann_event_protobuf_free (Event *event) /* {{{ */
 {
+       size_t i;
+
        if (event == NULL)
                return;
 
@@ -72,6 +74,15 @@ static void riemann_event_protobuf_free (Event *event) /* {{{ */
        event->tags = NULL;
        event->n_tags = 0;
 
+       for (i = 0; i < event->n_attributes; i++)
+       {
+               sfree (event->attributes[i]->key);
+               sfree (event->attributes[i]->value);
+               sfree (event->attributes[i]);
+       }
+       sfree (event->attributes);
+       event->n_attributes = 0;
+
        sfree (event);
 } /* }}} void riemann_event_protobuf_free */