canonicalize was returning a 4k buffer for everything, even though
the majority of canonical path names are much shorter. This
resulted in a lot of unused memory, which in turn made tar run
out of memory when tracking a lot of files:
http://lists.gnu.org/archive/html/bug-tar/2009-12/msg00011.html
* lib/canonicalize.c (canonicalize_filename_mode): Trim the
allocation to size.
Reported by Solar Designer <solar@openwall.com>.
Signed-off-by: Eric Blake <ebb9@byu.net>
+2009-12-19 Eric Blake <ebb9@byu.net>
+
+ canonicalize: reduce memory usage
+ * lib/canonicalize.c (canonicalize_filename_mode): Trim the
+ allocation to size.
+ Reported by Solar Designer <solar@openwall.com>.
+
2009-12-19 Bruno Haible <bruno@clisp.org>
New module attribute 'Applicability'.
if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && *dest == '/')
dest++;
*dest = '\0';
+ if (rname_limit != dest + 1)
+ rname = xrealloc (rname, dest - rname + 1);
free (extra_buf);
if (ht)