mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
ecdh_crypto: Use SSH_STRING_FREE()
Fixes T183
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 288bbd5bd0)
This commit is contained in:
@@ -101,7 +101,7 @@ int ssh_client_ecdh_init(ssh_session session){
|
|||||||
rc = ssh_buffer_add_ssh_string(session->out_buffer,client_pubkey);
|
rc = ssh_buffer_add_ssh_string(session->out_buffer,client_pubkey);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
EC_KEY_free(key);
|
EC_KEY_free(key);
|
||||||
ssh_string_free(client_pubkey);
|
SSH_STRING_FREE(client_pubkey);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ SSH_PACKET_CALLBACK(ssh_packet_server_ecdh_init){
|
|||||||
rc = ssh_dh_get_next_server_publickey_blob(session, &pubkey_blob);
|
rc = ssh_dh_get_next_server_publickey_blob(session, &pubkey_blob);
|
||||||
if (rc != SSH_OK) {
|
if (rc != SSH_OK) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Could not export server public key");
|
ssh_set_error(session, SSH_FATAL, "Could not export server public key");
|
||||||
ssh_string_free(sig_blob);
|
SSH_STRING_FREE(sig_blob);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,8 +309,8 @@ SSH_PACKET_CALLBACK(ssh_packet_server_ecdh_init){
|
|||||||
q_s_string, /* ecdh public key */
|
q_s_string, /* ecdh public key */
|
||||||
sig_blob); /* signature blob */
|
sig_blob); /* signature blob */
|
||||||
|
|
||||||
ssh_string_free(sig_blob);
|
SSH_STRING_FREE(sig_blob);
|
||||||
ssh_string_free(pubkey_blob);
|
SSH_STRING_FREE(pubkey_blob);
|
||||||
|
|
||||||
if (rc != SSH_OK) {
|
if (rc != SSH_OK) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
|
|||||||
Reference in New Issue
Block a user