From: Svetlana Shmidt Date: Fri, 21 Aug 2020 12:11:52 +0000 (+0000) Subject: fix dereferencing null pointer X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3538%2Fhead;p=thirdparty%2Fcollectd.git fix dereferencing null pointer --- diff --git a/src/daemon/metric.c b/src/daemon/metric.c index 2d9f93810..d18f51289 100644 --- a/src/daemon/metric.c +++ b/src/daemon/metric.c @@ -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); }