Re: [PATCH] Memory leak in locale.c set_default_locale

2017-06-08 Thread Eduardo Bustamante
On Thu, Jun 08, 2017 at 10:30:34AM -0400, Chet Ramey wrote: [...] > That would be strange behavior. If it complains about that, why doesn't it > complain about all memory that bash holds onto but doesn't free before it > exits? Hm. You're right. It seems to be glibc's fault here. The leak happens

Re: [PATCH] Memory leak in locale.c set_default_locale

2017-06-08 Thread Chet Ramey
On 6/8/17 10:24 AM, dualbus wrote: > After a closer reading, I think the Address Sanitizer is complaining > about bash's local copy (the one created with `savestring`) not being > released. > > It's not a real issue, but it makes running the tests with ASAN a bit > less useful. That would be str

Re: [PATCH] Memory leak in locale.c set_default_locale

2017-06-08 Thread dualbus
On Thu, Jun 08, 2017 at 09:59:39AM -0400, Chet Ramey wrote: [...] > Even though glibc allocates the memory for the current locale, the man page > warns not to assume that: > > "A successful call to setlocale() returns an opaque string that corre- > sponds to the locale set. This string may be a

Re: [PATCH] Memory leak in locale.c set_default_locale

2017-06-08 Thread Chet Ramey
On 6/7/17 9:46 PM, dualbus wrote: > *** /tmp/R6GbnO_locale.c 2017-06-07 20:40:25.575118629 -0500 > --- locale.c 2017-06-07 20:39:59.054419575 -0500 > *** > *** 85,91 > textdomain (PACKAGE); > > locale_mb_cur_max = MB_CUR_MAX; > ! locale_utf8locale = locale_isutf