@cryptotaxi247 / netdata-1 / commits / f0b19a4a2

Fix a memory leak on archived host creation (#13641)

When creating an archived host do not initialize labels (it is done already after host creation)

Stelios Fragkakis committed Sep 7, 2022 at 23:13 UTC f0b19a4a22a4b1b44715f51a8d6c8763e77c074d
1 file changed +2 -1
database/rrdhost.c
+2 -1
@@ -274,7 +274,8 @@ RRDHOST *rrdhost_create(const char *hostname,
274 #endif
275
276 netdata_rwlock_init(&host->rrdhost_rwlock);
277 - host->rrdlabels = rrdlabels_create();
277 + if (likely(!archived))
278 + host->rrdlabels = rrdlabels_create();
279
280 netdata_mutex_init(&host->aclk_state_lock);
281