fix for coverity warning
Costa Tsaousis (ktsaou) committed
Jun 18, 2017 at 01:39 UTC
6f64d2ad872ebb1ad17adad8f9a3425f5a636e9d
1 file changed
+1
-1
src/rrdhost.c
+1
-1
@@ -72,7 +72,7 @@ static inline void rrdhost_init_hostname(RRDHOST *host, const char *hostname) {
72
return;
73
74
void *old = host->hostname;
75
- host->hostname = strdupz(hostname);
75
+ host->hostname = strdupz(hostname?hostname:"localhost");
76
host->hash_hostname = simple_hash(host->hostname);
77
freez(old);
78
}