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
This commit is contained in:
Andreas Schneider
2009-04-01 21:24:16 +00:00
parent 1b627b3867
commit 891539af6c
9 changed files with 191 additions and 44 deletions

View File

@@ -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) {