Allocate pathname buffers dynamically
authorJeffrey Hutzelman <jhutz@cmu.edu>
Tue, 18 Jun 2013 01:08:14 +0000 (21:08 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 23 Apr 2015 04:52:35 +0000 (00:52 -0400)
commitfda2bc874751ca479365dc6389c0eebb41a0bda1
tree7980ac65321738aef7ece7d4ac6769accc5385e5
parent6f1979c83a4357c82be2e011b79d993b21e545f9
Allocate pathname buffers dynamically

This change reworks numerous places which formerly used potentially
large on-stack buffers (of size AFSDIR_PATH_MAX) for constructing or
storing pathnames.  Instead, these buffers are now allocated from the
heap, either by using asprintf() to build a pathname in a correctly
sized buffer or, where necessary, using malloc() to allocate a buffer
of size AFSDIR_PATH_MAX.

A few occurrances of AFSDIR_PATH_MAX-sized buffers are not changed;
these are generally either globals or are contained within another
data structure that is already allocated on the heap.

[kaduk@mit.edu convert to cleanup-handler memory management where
appropriate]

Change-Id: Ib1986187a1c467e867d50280aaf1d8a86d9108c8
Reviewed-on: http://gerrit.openafs.org/9985
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
15 files changed:
src/WINNT/afsreg/test/regman.c
src/bozo/bosoprocs.c
src/bozo/bosserver.c
src/bozo/fsbnodeops.c
src/bucoord/dsstub.c
src/butc/tcmain.c
src/kauth/kaserver.c
src/kauth/kdb.c
src/libadmin/cfg/cfgservers.c
src/ptserver/pts.c
src/update/client.c
src/update/server.c
src/vol/daemon_com.c
src/vol/salvaged.c
src/vol/vol-salvage.c