aboutsummaryrefslogtreecommitdiff
path: root/libssh/client.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-22 16:04:41 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-22 16:04:41 +0200
commit85a5eb94998763c43149b97b81f0a4b4904c6da8 (patch)
tree612c6b6086d14a4b20f31bc3451032a2ce3fac1e /libssh/client.c
parent3cd06a1f26057f36ef91c3fa86605d2b75905ffc (diff)
downloadlibssh-85a5eb94998763c43149b97b81f0a4b4904c6da8.tar.gz
libssh-85a5eb94998763c43149b97b81f0a4b4904c6da8.tar.xz
libssh-85a5eb94998763c43149b97b81f0a4b4904c6da8.zip
Fix a segfault if a NULL pointer is passed to ssh_disconnect().
Diffstat (limited to 'libssh/client.c')
-rw-r--r--libssh/client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 941fd0e..3f56a7b 100644
--- a/libssh/client.c
+++ b/libssh/client.c
@@ -623,13 +623,12 @@ char *ssh_get_issue_banner(SSH_SESSION *session) {
void ssh_disconnect(SSH_SESSION *session) {
STRING *str = NULL;
- enter_function();
-
if (session == NULL) {
- leave_function();
return;
}
+ enter_function();
+
if (ssh_socket_is_open(session->socket)) {
if (buffer_add_u8(session->out_buffer, SSH2_MSG_DISCONNECT) < 0) {
goto error;