]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
common: Fix a memory leak in plugin_value_list_to_metric_family().
authorFlorian Forster <octo@google.com>
Fri, 31 Jul 2020 06:54:47 +0000 (08:54 +0200)
committerFlorian Forster <octo@google.com>
Mon, 10 Aug 2020 06:48:04 +0000 (08:48 +0200)
The temporary metric_t needs to be reset, otherwise the labels leak.

src/utils/common/common.c

index 60c404570f4045fe8a497898c7e0ee1a7026ab9e..89fe6f52bac7ada4e6ff324a16fdf97f985c7787 100644 (file)
@@ -1167,6 +1167,7 @@ metric_family_t *plugin_value_list_to_metric_family(value_list_t const *vl,
     return NULL;
   }
 
+  metric_reset(&m);
   return fam;
 }