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 a09c723..328341e 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);