RFR: 8303070: Memory leak in DCmdArgument<char*>::parse_value [v2]

David Holmes dholmes at openjdk.org
Fri Feb 24 02:27:42 UTC 2023


> 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:

  Removed redundant clause

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12737/files
  - new: https://git.openjdk.org/jdk/pull/12737/files/bdb5ecba..7b89e023

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12737&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12737&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12737.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12737/head:pull/12737

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


More information about the hotspot-runtime-dev mailing list