RFR 8207060 : Memory leak when malloc fails within WITH_UNICODE_STRING block

Ivan Gerasimov ivan.gerasimov at oracle.com
Thu Jul 12 18:20:00 UTC 2018


Thanks Vyom and Roger for reviewing!


On 7/12/18 11:01 AM, Roger Riggs wrote:
> Looks fine Ivan,
>
> Thanks, Roger
>
>
> On 7/12/2018 2:40 AM, vyom tewari wrote:
>> Hi Ivan,
>>
>> Changes looks good to me, nice cleanup.
>>
>> Thanks,
>>
>> Vyom
>>
>>
>> On Wednesday 11 July 2018 09:45 PM, Ivan Gerasimov wrote:
>>> Hello!
>>>
>>> File src/java.base/windows/native/libjava/io_util_md.c
>>>
>>> In the function pathToNTPath(), memory is allocated with malloc() 
>>> within a block of macros WITH_UNICODE_STRING / END_UNICODE_STRING.
>>>
>>> In an unlikely event of malloc() failure, the function returns, 
>>> failing to release the string array acquired with WITH_UNICODE_STRING.
>>>
>>> Would you please help review the fix?
>>>
>>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8207060
>>> WEBREV: http://cr.openjdk.java.net/~igerasim/8207060/00/webrev/
>>>
>>> Thanks in advance!
>>>
>>
>
>

-- 
With kind regards,
Ivan Gerasimov



More information about the core-libs-dev mailing list