RFR: 8375684: Avoid leak in KeystoreImpl.m when using CFArrayCreateMutable

Weijun Wang weijun at openjdk.org
Mon Jan 26 15:03:44 UTC 2026


On Fri, 23 Jan 2026 18:41:35 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> @wangweij , could you please comment on the potential function usages that miss CFRelease ?
>> Should I address the others too in this PR or better in another one  ?
>
>> @wangweij , could you please comment on the potential function usages that miss CFRelease ? Should I address the others too in this PR or better in another one ?
> 
> Yes, seems all of them should be released. Have you tried `getInstance("KeychainStore")` again and again and see if there is any memory leak?

> > > @wangweij , could you please comment on the potential function usages that miss CFRelease ? Should I address the others too in this PR or better in another one ?
> > 
> > 
> > Yes, seems all of them should be released. Have you tried `getInstance("KeychainStore")` again and again and see if there is any memory leak?
> 
> No , I just looked at the coding (plus used some tool). Are there e.g. some good jtreg tests I should use to get more info about the leaks ?

I only find one automatic test related to macOS keystores: `java/security/KeyStore/CheckMacOSKeyChainTrust.java`. The other one -- `sun/security/tools/keytool/ListKeyChainStore.java` -- is manual.

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

PR Comment: https://git.openjdk.org/jdk/pull/29326#issuecomment-3800028752


More information about the security-dev mailing list