Code

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 791199ffb6302a8968749a23bedb677cd1d93f12..4df11bcf8f8491e732bd654e7443ad919a594a65 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 3d3c7ab2b7cfcb6a125783fdc95fcd792ce320ca..207ca05d68362a4ab168c6d16b968db3394c58b9 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;
 }