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:
@@ -1168,7 +1168,7 @@ libssh2_session_disconnect_ex(LIBSSH2_SESSION *session, int reason,
|
|||||||
const char *desc, const char *lang)
|
const char *desc, const char *lang)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
session->state = 0;
|
session->state &= ~LIBSSH2_STATE_EXCHANGING_KEYS;
|
||||||
BLOCK_ADJUST(rc, session,
|
BLOCK_ADJUST(rc, session,
|
||||||
session_disconnect(session, reason, desc, lang));
|
session_disconnect(session, reason, desc, lang));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user