From 178208f29d3d716a2e124d228c43ca0a271306c1 Mon Sep 17 00:00:00 2001 From: Svetlana Shmidt Date: Fri, 21 Aug 2020 12:11:52 +0000 Subject: [PATCH] fix dereferencing null pointer --- src/daemon/metric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.47.2