8255694: memory leak in JDWP debug agent after calling JVMTI GetAllThreads

Reviewed-by: amenkov, sspitsyn
This commit is contained in:
Chris Plummer 2020-11-02 20:13:32 +00:00
parent acb5f654b1
commit a250716ad2

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -836,6 +836,7 @@ threadControl_onHook(void)
*/ */
node->isStarted = JNI_TRUE; node->isStarted = JNI_TRUE;
} }
jvmtiDeallocate(threads);
} }
} END_WITH_LOCAL_REFS(env) } END_WITH_LOCAL_REFS(env)
@ -1549,7 +1550,8 @@ threadControl_suspendAll(void)
suspendAllCount++; suspendAllCount++;
} }
err: ; err:
jvmtiDeallocate(threads);
} END_WITH_LOCAL_REFS(env) } END_WITH_LOCAL_REFS(env)