mirror of https://github.com/macssh/macssh.git
Add more NULL checking/error handling
This commit is contained in:
parent
e40173c290
commit
19f2abd166
|
@ -1665,12 +1665,18 @@ void *ssh2_thread(WindRec*w)
|
|||
{
|
||||
LIBSSH2_SESSION *session = libssh2_session_init_ex(NULL, NULL, NULL, w);
|
||||
|
||||
if (!session) {
|
||||
syslog(0, "libssh2_session_init_ex() failed\n");
|
||||
goto closesocket;
|
||||
}
|
||||
|
||||
if (w->trace)
|
||||
libssh2_trace(session, INT_MAX);
|
||||
|
||||
libssh2_trace_sethandler(session, NULL, libssh2_handler);
|
||||
if (libssh2_session_startup(session, sock)) {
|
||||
syslog(0, "Failure establishing SSH session\n");
|
||||
goto closesession;
|
||||
}
|
||||
|
||||
if (!ssh2_hostkey_approved(session, hostname, w->portNum))
|
||||
|
|
Loading…
Reference in New Issue