Code

write_riemann plugin: plug leak on error
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 5 Dec 2015 11:11:26 +0000 (12:11 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 20:28:21 +0000 (21:28 +0100)
CID #37996

Signed-off-by: Florian Forster <octo@collectd.org>
src/write_riemann.c

index a09c72361f910ac8615a219fd9187da36e77a819..328341ea0e0fe9234feb8f6c5124379725f5bff9 100644 (file)
@@ -1051,6 +1051,7 @@ static int riemann_config(oconfig_item_t *ci) /* {{{ */
                        }
                        if ((val = strdup(child->values[1].value.string)) == NULL) {
                                WARNING("cannot allocate memory for attribute value.");
+                               sfree (key);
                                return (-1);
                        }
                        strarray_add(&riemann_attrs, &riemann_attrs_num, key);