From: Jim Meyering Date: Mon, 13 Nov 2006 14:06:15 +0000 (+0100) Subject: * src/sort.c (main): Plug a tiny memory leak. X-Git-Tag: COREUTILS-6_5~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5d00c7f9f2fc1bd43c1ef682e44117ff661ad01;p=thirdparty%2Fcoreutils.git * src/sort.c (main): Plug a tiny memory leak. Move declaration of local "minus" down to be nearer point of use. --- diff --git a/ChangeLog b/ChangeLog index 0bb7cd2069..33558767e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-13 Jim Meyering + + * 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 du would exit early, when encountering an inaccessible directory diff --git a/src/sort.c b/src/sort.c index e08d058024..56a0651ebb 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 = − }