diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-08-31 15:50:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-08-31 15:50:23 -0400 |
commit | dfddd43256f7ad4bad991eeff5cc51772595f327 (patch) | |
tree | 27e7540262ee86f9cdaaf283efb75230a75e3e89 /lib | |
parent | 27b4923ba00f0a7511c7ebf5f19313d6313052e9 (diff) | |
download | musl-dfddd43256f7ad4bad991eeff5cc51772595f327.tar.gz musl-dfddd43256f7ad4bad991eeff5cc51772595f327.tar.bz2 musl-dfddd43256f7ad4bad991eeff5cc51772595f327.tar.xz musl-dfddd43256f7ad4bad991eeff5cc51772595f327.zip |
debloat realpath's allocation strategy
rather than allocating a PATH_MAX-sized buffer when the caller does
not provide an output buffer, work first with a PATH_MAX-sized temp
buffer with automatic storage, and either copy it to the caller's
buffer or strdup it on success. this not only avoids massive memory
waste, but also avoids pulling in free (and thus the full malloc
implementation) unnecessarily in static programs.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions