]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
fix dereferencing null pointer 3538/head
authorSvetlana Shmidt <sshmidt@google.com>
Fri, 21 Aug 2020 12:11:52 +0000 (12:11 +0000)
committerSvetlana Shmidt <sshmidt@google.com>
Fri, 21 Aug 2020 12:11:52 +0000 (12:11 +0000)
src/daemon/metric.c

index 2d9f9381049cd999a5c5ceda2c9e7617fd6f4972..d18f51289a73c44f250029687ec5cf222920cb5f 100644 (file)
@@ -205,7 +205,7 @@ int metric_reset(metric_t *m) {
   label_set_reset(&m->label);
   meta_data_destroy(m->meta);
 
-  if (m->family->type == METRIC_TYPE_DISTRIBUTION) {
+  if (m->family != NULL && m->family->type == METRIC_TYPE_DISTRIBUTION) {
     distribution_destroy(m->value.distribution);
   }