On Wed, 8 Mar 2023 12:29:55 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> This patch fixes a possible native memory leak in case of a custom native 
>> GSS provider.
>> The actual leak was reported in production.
>> 
>> sun/security/jgss, sun/security/krb5, sun/net/www/protocol/http jtreg tests 
>> are passed
>
> src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java 
> line 525:
> 
>> 523:     public void disposeContext() {
>> 524:         // do nothing
>> 525:     }
> 
> It would be good to have some comment explaining the purpose of this method. 
> In particular, it would be good to state when (at which point) it is supposed 
> to be called.
> Also hopefully the `AuthenticationInfo` object remain valid and can still be 
> used after `disposeContext` has been called?

Right, `AuthenticationInfo` is still valid after `disposeContext`.
The Negotiator with the new context will be recreated if required 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java#L224

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

PR: https://git.openjdk.org/jdk/pull/12920

Reply via email to