summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-22 16:04:41 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-23 09:07:49 +0200
commita8ce546f69e1d1d2425cdd3358b2083b0a6cebcb (patch)
treefc1409b528ed0a733e1128501a65f0ea6e856d79
parent6e56d1dfb20c705930770a96f6d84730a4f58a14 (diff)
downloadlibssh-a8ce546f69e1d1d2425cdd3358b2083b0a6cebcb.tar.gz
libssh-a8ce546f69e1d1d2425cdd3358b2083b0a6cebcb.tar.xz
libssh-a8ce546f69e1d1d2425cdd3358b2083b0a6cebcb.zip
Fix a segfault if a NULL pointer is passed to ssh_disconnect().
-rw-r--r--libssh/client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 7cc6f7d1..5fdec8ee 100644
--- a/libssh/client.c
+++ b/libssh/client.c
@@ -628,13 +628,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;