1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +03:00

session_disconnect: don't zero state, just clear the right bit

If we clear the entire field, the freeing of data in session_free() is
skipped. Instead just clear the bit that risk making the code get stuck
in the transport functions.

Regression from 4d66f6762c.

Reported-by: dimmaq on github
Fixes #338
Closes #340
This commit is contained in:
Daniel Stenberg
2019-03-23 23:51:55 +01:00
parent e1ead35e47
commit 87fc75b23d

View File

@@ -1168,7 +1168,7 @@ libssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason,
const char *desc, const char *lang)
{
int rc;
session->state = 0;
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
BLOCK_ADJUST(rc, session,
session_disconnect(session, reason, desc, lang));