Integrated: 8266187: Memory leak in appendBootClassPath()

Wang Huang whuang at openjdk.java.net
Tue May 4 10:05:06 UTC 2021


On Wed, 28 Apr 2021 06:38:57 GMT, Wang Huang <whuang at openjdk.org> wrote:

> Dear All, 
>     I find a memory leak in `appendBootClassPath()`
> https://github.com/openjdk/jdk/blob/75a2354dc276e107d64516d20fc72bc7ef3d5f86/src/java.instrument/share/native/libinstrument/InvocationAdapter.c#L950
> * we malloc `resolved` from resolve(parent, path)
> * we use `resolved` in line 951 
> * we don't free() this memory after using.
> 
> I think we can fix this bug by adding a free() after line 951 as my commit.
> Thank you for your review. Any suggestion is welcome.
> 
> Yours , 
> Wang Huang

This pull request has now been integrated.

Changeset: aa90df6f
Author:    Wang Huang <whuang at openjdk.org>
Committer: Kevin Walls <kevinw at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/aa90df6f51940a73f9aa078a32768855c8568034
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8266187: Memory leak in appendBootClassPath()

Co-authored-by: Wang Huang <whuang at openjdk.org>
Co-authored-by: Sun Jianye <sunjianye at huawei.com>
Reviewed-by: kevinw, mli, alanb

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

PR: https://git.openjdk.java.net/jdk/pull/3751


More information about the serviceability-dev mailing list