X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_prometheus.c;h=61c43fed7ae921265e049c663804a92e0273a060;hb=295947714f23935be771c98f1071564d5567d33a;hp=991415ef08713ddb7939e63fd7d5d196a3d35981;hpb=facbb03bdd0c591344b1a81dd0437064cfcc24e5;p=collectd.git diff --git a/src/write_prometheus.c b/src/write_prometheus.c index 991415ef..61c43fed 100644 --- a/src/write_prometheus.c +++ b/src/write_prometheus.c @@ -694,8 +694,10 @@ metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index, return fam; } - if (!allocate) + if (!allocate) { + sfree(name); return NULL; + } fam = metric_family_create(name, ds, vl, ds_index); if (fam == NULL) { @@ -868,5 +870,3 @@ void module_register() { /* user data = */ NULL); plugin_register_shutdown("write_prometheus", prom_shutdown); } - -/* vim: set sw=2 sts=2 et fdm=marker : */