RFR: 8303070: Memory leak in DCmdArgument<char*>::parse_value [v4]
Erik Österlund
eosterlund at openjdk.org
Wed Mar 1 10:10:41 UTC 2023
On Sat, 25 Feb 2023 02:36:36 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> If we have a default value for the char* DCmdArgument we copy it into the `_value` field using `parse_value` to make a copy in C-heap. If we then parse an actual argument value, we replace the default but don't free it. The parse method needs to use realloc.
>>
>> Thanks to @jcking for spotting the cause.
>>
>> Testing: tiers 1-3
>>
>> Thanks.
>
> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>
> Update test coverage for the empty and null cases
The change looks good. Since I was asked to review in Coleen's absence, I feel like I just have to mention it's a bit weird that a template specialization of destroy_value causes different behaviour, and that I don't really like templates. But the change looks good.
-------------
Marked as reviewed by eosterlund (Reviewer).
PR: https://git.openjdk.org/jdk/pull/12737
More information about the hotspot-runtime-dev
mailing list