Skip to content

Commit 1d769d2

Browse files
committed
Ensure GSSContext is disposed after initializing security context
Signed-off-by: raccoonback <[email protected]>
1 parent 84e592f commit 1d769d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reactor-netty-http/src/main/java/reactor/netty/http/client/SpnegoAuthProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ private byte[] generateSpnegoToken(String hostName) throws GSSException {
158158
Oid spnegoOid = new Oid(STR_OID); // SPNEGO OID
159159

160160
GSSContext context = gssManager.createContext(serverName, spnegoOid, null, GSSContext.DEFAULT_LIFETIME);
161-
return context.initSecContext(new byte[0], 0, 0);
161+
try {
162+
return context.initSecContext(new byte[0], 0, 0);
163+
} finally {
164+
context.dispose();
165+
}
162166
}
163167

164168
/**

0 commit comments

Comments
 (0)