RFR: JDK-8025712, , (props) Possible memory leak in java_props_md.c / ParseLocale
Dan Xu
dan.xu at oracle.com
Fri Oct 11 02:46:04 UTC 2013
Thanks for your clarification, Naoto.
Here is the updated webrev,
http://cr.openjdk.java.net/~dxu/8025712/webrev.01/. Please help review it.
-Dan
On 10/10/2013 03:14 PM, Naoto Sato wrote:
> You could, but that part only relates to the @euro locales handling,
> which is at this moment almost obsolete, let alone for MacOSX
> platform. So the current code should work fine.
>
> Naoto
>
> On 10/10/13 1:23 PM, Dan Xu wrote:
>> Good catch, Chris.
>>
>> Btw, according to the description, it seems the block in #ifndef
>> __linux__ is the workaround only for Solaris. Shall we use a more strict
>> macro here instead of #ifndef __linux__? Thanks!
>>
>> -Dan
>>
>> On 10/10/2013 02:22 AM, Chris Hegarty wrote:
>>> Dan,
>>>
>>> Your changes look fine to me.
>>>
>>> While looking at this I notice that there is another potential leak.
>>> If the malloc for temp fails, then we need to free lc ( for MAC only
>>> ), right?
>>>
>>> -Chris.
>>>
>>> On 10/09/2013 07:51 PM, Dan Xu wrote:
>>>> Hi All,
>>>>
>>>> This fix is to solve the memory leak issue in ParseLocale()
>>>> function of
>>>> jdk/src/solaris/native/java/lang/java_props_md.c. Because the locale,
>>>> lc, is copied into temp, it is not necessary to do the strdup(), which
>>>> leads to the memery leak. The fix simply removes the line of strdup
>>>> operation. Thanks!
>>>>
>>>> Webrev: http://cr.openjdk.java.net/~dxu/8025712/webrev/
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8025712
>>>>
>>>> -Dan
>>
>
More information about the core-libs-dev
mailing list