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

Dmitry Kovalenko d.kovalenko@postgrespro.ru
Mon Jun 2 13:10:25 GMT 2025


>> +  {
>> +    char s[] = "LOCPATH=/usr/share/locale";
> As far as I understand it, this path is not actually used.  Is this
> accurate?  If so, please add a comment.  Ordinarily, this would be a
> test bug because it fails to isolate the test from the host environment.

I tested "LOCALPATH=."

     int const r = setenv ("LOCPATH", ".", 1);

1) The test of OLD newlocale returns a memory leaks

---------- tst-newlocale-mem.out:

Memory not freed:
-----------------
            Address     Size     Caller
0x00005555591b74c0     0x12  at 0x9a9e4

---------- tst-newlocale-mem.test-result:

FAIL: locale/tst-newlocale-mem
original exit status 1

2) The test of NEW newlocale works without errors

---------- tst-newlocale-mem.out:

No memory leaks.

Thanks&Regards

Dmitry Kovalenko



More information about the Libc-alpha mailing list