summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-11-13 15:06:15 +0100
committerJim Meyering <jim@meyering.net>2006-11-13 15:06:15 +0100
commitd5d00c7f9f2fc1bd43c1ef682e44117ff661ad01 (patch)
treee677a69ccb4375552b8b0fae0ba73db5b44fab48 /src
parent84268dae4ebb8a1d7ddf266a8acc6ab15db3a768 (diff)
downloadcoreutils-d5d00c7f9f2fc1bd43c1ef682e44117ff661ad01.tar.xz
* src/sort.c (main): Plug a tiny memory leak.
Move declaration of local "minus" down to be nearer point of use.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c
index e08d05802..56a0651eb 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -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;
}