mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
kex: Use SSH_STRING_FREE()
Fixes T183 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
14
src/kex.c
14
src/kex.c
@@ -392,7 +392,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit)
|
|||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
ssh_string_free(str);
|
SSH_STRING_FREE(str);
|
||||||
str = NULL;
|
str = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,7 +527,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit)
|
|||||||
return SSH_PACKET_USED;
|
return SSH_PACKET_USED;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
ssh_string_free(str);
|
SSH_STRING_FREE(str);
|
||||||
for (i = 0; i < SSH_KEX_METHODS; i++) {
|
for (i = 0; i < SSH_KEX_METHODS; i++) {
|
||||||
if (server_kex) {
|
if (server_kex) {
|
||||||
session->next_crypto->client_kex.methods[i] = NULL;
|
session->next_crypto->client_kex.methods[i] = NULL;
|
||||||
@@ -834,7 +834,7 @@ int ssh_send_kex(ssh_session session, int server_kex) {
|
|||||||
if (ssh_buffer_add_ssh_string(session->out_buffer, str) < 0) {
|
if (ssh_buffer_add_ssh_string(session->out_buffer, str) < 0) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
ssh_string_free(str);
|
SSH_STRING_FREE(str);
|
||||||
str = NULL;
|
str = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,7 +855,7 @@ int ssh_send_kex(ssh_session session, int server_kex) {
|
|||||||
error:
|
error:
|
||||||
ssh_buffer_reinit(session->out_buffer);
|
ssh_buffer_reinit(session->out_buffer);
|
||||||
ssh_buffer_reinit(session->out_hashbuf);
|
ssh_buffer_reinit(session->out_hashbuf);
|
||||||
ssh_string_free(str);
|
SSH_STRING_FREE(str);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1018,7 +1018,7 @@ int ssh_make_sessionid(ssh_session session)
|
|||||||
ssh_buffer_get_len(server_hash),
|
ssh_buffer_get_len(server_hash),
|
||||||
ssh_buffer_get(server_hash),
|
ssh_buffer_get(server_hash),
|
||||||
server_pubkey_blob);
|
server_pubkey_blob);
|
||||||
ssh_string_free(server_pubkey_blob);
|
SSH_STRING_FREE(server_pubkey_blob);
|
||||||
if(rc != SSH_OK){
|
if(rc != SSH_OK){
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@@ -1207,7 +1207,7 @@ error:
|
|||||||
session->in_hashbuf = NULL;
|
session->in_hashbuf = NULL;
|
||||||
session->out_hashbuf = NULL;
|
session->out_hashbuf = NULL;
|
||||||
|
|
||||||
ssh_string_free(num);
|
SSH_STRING_FREE(num);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -1397,7 +1397,7 @@ int ssh_generate_session_keys(ssh_session session)
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
error:
|
error:
|
||||||
ssh_string_burn(k_string);
|
ssh_string_burn(k_string);
|
||||||
ssh_string_free(k_string);
|
SSH_STRING_FREE(k_string);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
free(IV_cli_to_srv);
|
free(IV_cli_to_srv);
|
||||||
free(IV_srv_to_cli);
|
free(IV_srv_to_cli);
|
||||||
|
|||||||
Reference in New Issue
Block a user