Fixed the order of the check in the BLOCK_ADJUST() macro so that it also works
for libssh2_session_free()
This commit is contained in:
parent
1d2bd301d3
commit
ad8b49b208
@ -1241,7 +1241,9 @@ int _libssh2_pem_decode_integer(unsigned char **data, unsigned int *datalen,
|
||||
#define BLOCK_ADJUST(rc,sess,x) \
|
||||
do { \
|
||||
rc = x; \
|
||||
if(!sess->api_block_mode || (rc != LIBSSH2_ERROR_EAGAIN)) \
|
||||
/* the order of the check below is important to properly deal with the
|
||||
case when the 'sess' is freed */ \
|
||||
if((rc != LIBSSH2_ERROR_EAGAIN) || !sess->api_block_mode) \
|
||||
break; \
|
||||
rc = _libssh2_wait_socket(sess); \
|
||||
if(rc) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user