Code

write_riemann plugin: Really fix a memory leak.
authorFlorian Forster <octo@collectd.org>
Tue, 23 Apr 2013 05:15:44 +0000 (07:15 +0200)
committerFlorian Forster <octo@collectd.org>
Tue, 23 Apr 2013 08:43:33 +0000 (10:43 +0200)
Github: #307

src/write_riemann.c

index b5242172d0bfdba043cc1b6c0aa5aa01290ea073..15bb23787c59f7b4f01d543c621a75fee2be42f4 100644 (file)
@@ -73,7 +73,11 @@ static void riemann_event_protobuf_free (Event *event) /* {{{ */
        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;