[METRICS-390] Make sure HostTags is initialized if not configured
authorKevin Bowling <kbowling@llnw.com>
Wed, 11 Jun 2014 08:44:02 +0000 (01:44 -0700)
committerMarc Fournier <marc.fournier@camptocamp.com>
Wed, 13 Aug 2014 12:05:25 +0000 (14:05 +0200)
src/write_tsdb.c

index 8b10fd6..bf83560 100644 (file)
@@ -407,6 +407,7 @@ static int wt_send_message (const char* key, const char* value,
     char *temp = NULL;
     char *tags = "";
     char message[1024];
+    char *host_tags = cb->host_tags ? cb->host_tags : "";
     const char *message_fmt;
     const char *meta_tsdb = "tsdb_tags";
 
@@ -437,7 +438,7 @@ static int wt_send_message (const char* key, const char* value,
                                       value,
                                       host,
                                       tags,
-                                      cb->host_tags);
+                                      host_tags);
 
     sfree(temp);