Skip to content

Commit 713c020

Browse files
author
Yuri Nesterenko
committedFeb 16, 2023
8301760: Fix possible leak in SpNegoContext dispose
Reviewed-by: phh Backport-of: 3f3356bcbd2b2fbc545263dc70a48ee931a4e56b
1 parent 71108a5 commit 713c020

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ public final Provider getProvider() {
244244
}
245245

246246
public final void dispose() throws GSSException {
247-
mechContext = null;
248247
state = STATE_DELETED;
248+
if (mechContext != null) {
249+
mechContext.dispose();
250+
mechContext = null;
251+
}
249252
}
250253

251254
/**

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Feb 16, 2023

@openjdk-notifier[bot]
Please sign in to comment.