Code

[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)
committerKevin Bowling <kbowling@llnw.com>
Wed, 11 Jun 2014 08:44:02 +0000 (01:44 -0700)
src/write_tsdb.c

index 8b10fd6193344ca2c06fbd2966b56b7cc63bf546..bf83560cf32dcca9eb63f7f64508f6c79cfa31e5 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);