Fix my recent session->sftpInit_sftp fix which wasn't correct. The memory area
does not need to be freed (it already gets freed) but clearing the pointer is a good idea. And it should be done _after_ the channel_free() call.
Этот коммит содержится в:
родитель
fdc043e7b1
Коммит
c5f335ad4f
10
src/sftp.c
10
src/sftp.c
@ -791,12 +791,14 @@ 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);
|
||||
|
||||
if (session->sftpInit_sftp)
|
||||
/* the SFTP stuff is freed by the stored "destructor" as part of the
|
||||
channel free magic */
|
||||
session->sftpInit_sftp = NULL;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user