Integrated: 8303070: Memory leak in DCmdArgument<char*>::parse_value

David Holmes dholmes at openjdk.org
Wed Mar 1 21:48:24 UTC 2023


On Fri, 24 Feb 2023 00:26:13 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.

This pull request has now been integrated.

Changeset: 6e19387f
Author:    David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6e19387f29944aa9d5c82bf0ece3abf0ca53b39c
Stats:     28 lines in 2 files changed: 14 ins; 10 del; 4 mod

8303070: Memory leak in DCmdArgument<char*>::parse_value

Reviewed-by: fparain, jcking, jsjolen, eosterlund, coleenp

-------------

PR: https://git.openjdk.org/jdk/pull/12737


More information about the hotspot-runtime-dev mailing list