[PATCH 3/6] posix: Use malloc instead of alloca for the glob user name

Collin Funk collin.funk1@gmail.com
Thu Aug 6 01:42:13 GMT 2026


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:

> Use malloc unconditionally.  The name is only needed for the passwd
> lookup that follows, which is far more expensive than the allocation.
>
> Checked on x86_64-linux-gnu, aarch64-linux-gnu, and i686-linux-gnu.
> ---
>  posix/glob.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)

Looks good.

It annoys me slightly that we use "int" instead of "bool" there, but
that is separate from your patches. :)

Reviewed-by: Collin Funk <collin.funk1@gmail.com>

Collin


More information about the Libc-alpha mailing list