Fix crash in sftp_close_handle.
Don't free dir handle data when it's not a dir handle!
This commit is contained in:
parent
3f24fb005e
commit
6f13a93be9
5
README
5
README
@ -1,6 +1,11 @@
|
|||||||
libssh2 - SSH2 library
|
libssh2 - SSH2 library
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
Version 0.4
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Fixed crash when trying to free sftp_dirhandle data from a filehandle struct.
|
||||||
|
|
||||||
Version 0.3
|
Version 0.3
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
@ -950,7 +950,8 @@ LIBSSH2_API int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle)
|
|||||||
handle->next->prev = NULL;
|
handle->next->prev = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle->u.dir.names_left) {
|
if ((handle->handle_type == LIBSSH2_SFTP_HANDLE_DIR) &&
|
||||||
|
handle->u.dir.names_left) {
|
||||||
LIBSSH2_FREE(session, handle->u.dir.names_packet);
|
LIBSSH2_FREE(session, handle->u.dir.names_packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user