mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
- Anonymous bug report #2795816 revealed that libssh2_sftp_shutdown() did not
properly free/cleanup the SFTP handle so libssh2 leaked memory and caused an assert() on subsequent libssh2_sftp_init() calls on the same session.
This commit is contained in:
@@ -791,7 +791,10 @@ sftp_shutdown(LIBSSH2_SFTP *sftp)
|
||||
LIBSSH2_FREE(session, sftp->symlink_packet);
|
||||
sftp->symlink_packet = NULL;
|
||||
}
|
||||
|
||||
if (session->sftpInit_sftp) {
|
||||
LIBSSH2_FREE(session, session->sftpInit_sftp);
|
||||
session->sftpInit_sftp = NULL;
|
||||
}
|
||||
rc = _libssh2_channel_free(sftp->channel);
|
||||
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user