On Mon, 28 Nov 2022 03:23:01 GMT, Justin King <jck...@openjdk.org> wrote:
> Fix memory leaks by making `AddOption` unconditionally duplicate passed in > strings, taking ownership. Callers using dynamic memory free their storage > after calling `AddOption`. This ensures no memory is dropped on the floor. > This also removes the second argument to `AddOption` as it is unused and > shifts it into the source file. Switched to maintaining a separate list of allocated strings instead of always duplicating strings. `AddOptions` does not take ownership of the underlying string. `AddAllocatedOptions` is `AddOptions` but the given string is freed later after the the JVM has been initialized. ------------- PR: https://git.openjdk.org/jdk/pull/11384