aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-10-28 13:52:05 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-09 16:38:36 +0100
commit0469458194db33008861c9721a7057b403b1d02f (patch)
tree00a3bddd569fa8e2c92aeabbf3133f606844ceef
parentd0dc57be06eb648a1f924fa53ef86837e9b2c52b (diff)
downloadlibssh-0469458194db33008861c9721a7057b403b1d02f.tar.gz
libssh-0469458194db33008861c9721a7057b403b1d02f.tar.xz
libssh-0469458194db33008861c9721a7057b403b1d02f.zip
kex: 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 7c3a6ca6bcf139e70ee7b9bf4feee05501172790)
-rw-r--r--src/kex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/kex.c b/src/kex.c
index ac52a19b..ce591f57 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -392,7 +392,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit)
ssh_set_error_oom(session);
goto error;
}
- ssh_string_free(str);
+ SSH_STRING_FREE(str);
str = NULL;
}
@@ -527,7 +527,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit)
return SSH_PACKET_USED;
error:
- ssh_string_free(str);
+ SSH_STRING_FREE(str);
for (i = 0; i < SSH_KEX_METHODS; i++) {
if (server_kex) {
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) {
goto error;
}
- ssh_string_free(str);
+ SSH_STRING_FREE(str);
str = NULL;
}
@@ -855,7 +855,7 @@ int ssh_send_kex(ssh_session session, int server_kex) {
error:
ssh_buffer_reinit(session->out_buffer);
ssh_buffer_reinit(session->out_hashbuf);
- ssh_string_free(str);
+ SSH_STRING_FREE(str);
return -1;
}
@@ -1018,7 +1018,7 @@ int ssh_make_sessionid(ssh_session session)
ssh_buffer_get_len(server_hash),
ssh_buffer_get(server_hash),
server_pubkey_blob);
- ssh_string_free(server_pubkey_blob);
+ SSH_STRING_FREE(server_pubkey_blob);
if(rc != SSH_OK){
goto error;
}
@@ -1207,7 +1207,7 @@ error:
session->in_hashbuf = NULL;
session->out_hashbuf = NULL;
- ssh_string_free(num);
+ SSH_STRING_FREE(num);
return rc;
}
@@ -1397,7 +1397,7 @@ int ssh_generate_session_keys(ssh_session session)
rc = 0;
error:
ssh_string_burn(k_string);
- ssh_string_free(k_string);
+ SSH_STRING_FREE(k_string);
if (rc != 0) {
free(IV_cli_to_srv);
free(IV_srv_to_cli);