mirror of https://git.musl-libc.org/git/musl
Browse Source
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.rs-1.0
1 changed files with 6 additions and 12 deletions
Loading…
Reference in new issue