@cryptotaxi247 / netdata-1 / commits / aff92fd15

prevent NULL dereference when host tags are not set - again

Costa Tsaousis (ktsaou) committed Jun 17, 2017 at 22:32 UTC aff92fd15f8f6a4b2c4ea60ab5aeeaca10f6d802
1 file changed +1 -1
src/rrdhost.c
+1 -1
@@ -60,7 +60,7 @@ RRDHOST *rrdhost_find_by_hostname(const char *hostname, uint32_t hash) {
60
61 static inline void rrdhost_init_tags(RRDHOST *host, const char *tags) {
62 freez((void *)host->tags);
63 - host->tags = strdupz(tags);
63 + host->tags = (tags && *tags)?strdupz(tags):NULL;
64 }
65
66 static inline void rrdhost_init_hostname(RRDHOST *host, const char *hostname) {