RFR: JDK-8297688: libjli leaks memory related to options handling
David Holmes
dholmes at openjdk.org
Mon Nov 28 04:48:33 UTC 2022
On Mon, 28 Nov 2022 03:23:01 GMT, Justin King <jcking at 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.
Sorry I misread things.
I do worry about the extra overhead of this additional string copying though ... but I will leave that for core-libs folk to decide.
-------------
PR: https://git.openjdk.org/jdk/pull/11384
More information about the core-libs-dev
mailing list