Hello, At either sort.c 3488 or 3647 temp_dirs is alloc'd through add_temp_dir(). In any case temp_dirs is going to alloc'd. This patch frees temp_dirs at the bottom of main().
>From b65f65a84dde8447636c7b3efa597b5ac93dddd3 Mon Sep 17 00:00:00 2001 From: Joey Degges <jdeg...@gmail.com> Date: Mon, 15 Feb 2010 23:33:09 -0800 Subject: [PATCH 2/3] Fix minor memory leak: temp_dirs is never free'd --- src/sort.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/sort.c b/src/sort.c index 4c6ca45..94f5b64 100644 --- a/src/sort.c +++ b/src/sort.c @@ -3694,6 +3694,7 @@ main (int argc, char **argv) if (nfiles != 0) free (files); + free (temp_dirs); if (have_read_stdin && fclose (stdin) == EOF) die (_("close failed"), "-"); -- 1.6.6.1