aboutsummaryrefslogtreecommitdiff
path: root/libssh/session.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-01 21:24:16 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-01 21:24:16 +0000
commit891539af6cbdbdfabb8d37fb491f7f8cadf9823c (patch)
tree1699cb47cd68dc35a972f8b5e1d834946c48d944 /libssh/session.c
parent1b627b386763e22a7b8f7a7c8de9610c1da56cd2 (diff)
downloadlibssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.tar.gz
libssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.tar.xz
libssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.zip
Add memory error checks for crypto wrapper functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@330 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/session.c')
-rw-r--r--libssh/session.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libssh/session.c b/libssh/session.c
index 6c88c6c..02eaf0b 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -43,6 +43,9 @@ SSH_SESSION *ssh_new(void) {
SSH_SESSION *session=malloc(sizeof (SSH_SESSION));
memset(session,0,sizeof(SSH_SESSION));
session->next_crypto=crypto_new();
+ if (session->next_crypto == NULL) {
+ goto err;
+ }
session->maxchannel=FIRST_CHANNEL;
session->socket = ssh_socket_new(session);
if (session->socket == NULL) {