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

@@ -307,7 +307,10 @@ static int dh_handshake_server(SSH_SESSION *session){
crypto_free(session->current_crypto);
/* XXX later, include a function to change keys */
session->current_crypto=session->next_crypto;
session->next_crypto=crypto_new();
session->next_crypto = crypto_new();
if (session->next_crypto == NULL) {
return -1;
}
return 0;
}
/* do the banner and key exchange */