Merge branch 'collectd-5.7'
[collectd.git] / src / write_prometheus.c
index 6dee98a..61c43fe 100644 (file)
@@ -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) {