]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
hostname: pacify valgrind
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Mar 2021 18:20:18 +0000 (11:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Mar 2021 18:21:15 +0000 (11:21 -0700)
* src/hostname.c (main) [IF_LINT]: Free hostname (Bug#47384).

src/hostname.c

index 008682f39d5f09a2546da1d406694f49144065f7..94b07058200436c2a756a784e8525932e5a312bb 100644 (file)
@@ -104,6 +104,7 @@ main (int argc, char **argv)
       if (hostname == NULL)
         die (EXIT_FAILURE, errno, _("cannot determine hostname"));
       puts (hostname);
+      IF_LINT (free (hostname));
     }
 
   if (optind + 1 < argc)