Skip to content

Commit 3e01002

Browse files
committed
Dereference waithandle instance field before disposing it.
1 parent 9f67d3d commit 3e01002

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public override AuthenticationResult Authenticate(Session session)
8181
private void Session_UserAuthenticationSuccessReceived(object sender, MessageEventArgs<SuccessMessage> e)
8282
{
8383
_authenticationResult = AuthenticationResult.Success;
84-
8584
_authenticationCompleted.Set();
8685
}
8786

@@ -160,8 +159,8 @@ protected virtual void Dispose(bool disposing)
160159
var authenticationCompleted = _authenticationCompleted;
161160
if (authenticationCompleted != null)
162161
{
163-
authenticationCompleted.Dispose();
164162
_authenticationCompleted = null;
163+
authenticationCompleted.Dispose();
165164
}
166165

167166
_isDisposed = true;

0 commit comments

Comments
 (0)