[PATCH v9] locale: memory leak in newlocale [BZ #25770]

Florian Weimer fweimer@redhat.com
Thu Jun 5 09:48:42 GMT 2025


* Andreas Schwab:

> On Jun 05 2025, Florian Weimer wrote:
>
>> Andreas, can the asserts stay, or should Dmitry remove them?
>
> If the compiler removes them they don't do any harm.

The first assert

  assert (locale_path_ptr != NULL);

is not removed for some reason.  This looks like a GCC bug to me.  GCC
is generally able to determine that addresses on the stack cannot be
null.

I suppose we can remove the assert.

The one after __argz_add_sep does not get optimized out, either, but
that's correct, and I think the assert is valid.

Thanks,
Florian



More information about the Libc-alpha mailing list