diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-01-10 11:24:15 +0100 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-01-10 11:24:15 +0100 |
commit | d631ce32edf658f9bf9d39be84ed2c9fab460b00 (patch) | |
tree | 37e5491c3a2d1e8604ee64dc486c90a61eddbcdc /src/kex.c | |
parent | 4439d5c774d5ebf42aeb9fc9fed9b66403b77c91 (diff) | |
download | libssh-d631ce32edf658f9bf9d39be84ed2c9fab460b00.tar.gz libssh-d631ce32edf658f9bf9d39be84ed2c9fab460b00.tar.xz libssh-d631ce32edf658f9bf9d39be84ed2c9fab460b00.zip |
All error path consistent with ssh_packet_kexinit
Diffstat (limited to 'src/kex.c')
-rw-r--r-- | src/kex.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -290,11 +290,13 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){ } if (buffer_add_ssh_string(session->in_hashbuf, str) < 0) { + ssh_set_error(session, SSH_FATAL, "Error adding string in hash buffer"); goto error; } strings[i] = ssh_string_to_char(str); if (strings[i] == NULL) { + ssh_set_error_oom(session); goto error; } ssh_string_free(str); @@ -305,8 +307,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){ if (server_kex) { session->client_kex.methods = malloc(10 * sizeof(char **)); if (session->client_kex.methods == NULL) { - leave_function(); - return -1; + ssh_set_error_oom(session); + goto error; } for (i = 0; i < 10; i++) { @@ -315,8 +317,8 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){ } else { /* client */ session->server_kex.methods = malloc(10 * sizeof(char **)); if (session->server_kex.methods == NULL) { - leave_function(); - return -1; + ssh_set_error_oom(session); + goto error; } for (i = 0; i < 10; i++) { |