From 891539af6cbdbdfabb8d37fb491f7f8cadf9823c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 1 Apr 2009 21:24:16 +0000 Subject: 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 --- libssh/session.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libssh/session.c') 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) { -- cgit