Minor changes to address PR comments.
authorcampbellsean@google.com <campbellsean@google.com>
Wed, 18 Oct 2017 20:48:50 +0000 (16:48 -0400)
committercampbellsean@google.com <campbellsean@google.com>
Wed, 18 Oct 2017 20:48:50 +0000 (16:48 -0400)
src/daemon/collectd.c
src/daemon/globals.c

index 791199f..4df11bc 100644 (file)
@@ -86,7 +86,6 @@ static int init_hostname(void) {
     hostname_len = NI_MAXHOST;
   }
   char hostname[hostname_len];
-  hostname_set(hostname);
 
   str = global_option_get("Hostname");
   if ((str != NULL) && (str[0] != 0)) {
index 3d3c7ab..207ca05 100644 (file)
@@ -43,6 +43,6 @@ void hostname_set(char const *hostname) {
   if (h == NULL)
     return;
 
-  free(hostname_g);
+  sfree(hostname_g);
   hostname_g = h;
 }