]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* src/sort.c (main): Plug a tiny memory leak.
authorJim Meyering <jim@meyering.net>
Mon, 13 Nov 2006 14:06:15 +0000 (15:06 +0100)
committerJim Meyering <jim@meyering.net>
Mon, 13 Nov 2006 14:06:15 +0000 (15:06 +0100)
Move declaration of local "minus" down to be nearer point of use.

ChangeLog
src/sort.c

index 0bb7cd2069a557be0b20b47755b8c7cf3e8f401a..33558767e9126ad73bff926614d503a468d21a1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-13  Jim Meyering  <jim@meyering.net>
+
+       * src/sort.c (main): Plug a tiny memory leak.
+       Move declaration of local "minus" down to be nearer point of use.
+
 2006-11-12  Jim Meyering  <jim@meyering.net>
 
        du would exit early, when encountering an inaccessible directory
index e08d058024ad90a440a3a6a3c3d0223132716495..56a0651ebb63c58c8adfc9630ead6f51fd6dbd6c 100644 (file)
@@ -2292,7 +2292,7 @@ main (int argc, char **argv)
   size_t nfiles = 0;
   bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
   bool obsolete_usage = (posix2_version () < 200112);
-  char *minus = "-", **files;
+  char **files;
   char const *outfile = NULL;
 
   initialize_main (&argc, &argv);
@@ -2657,7 +2657,9 @@ main (int argc, char **argv)
 
   if (nfiles == 0)
     {
+      static char *minus = "-";
       nfiles = 1;
+      free (files);
       files = &minus;
     }