diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2019-10-31 09:42:10 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-12-09 16:38:36 +0100 |
commit | e6fdb28fafbacfc66b07477ab3a9d6549c7b1ab1 (patch) | |
tree | 5d34e863a7c41bed6959dc80b77c5d79a300c5ec | |
parent | b21cba0c3cf6008dc13e13bc928f069c63cb4549 (diff) | |
download | libssh-e6fdb28fafbacfc66b07477ab3a9d6549c7b1ab1.tar.gz libssh-e6fdb28fafbacfc66b07477ab3a9d6549c7b1ab1.tar.xz libssh-e6fdb28fafbacfc66b07477ab3a9d6549c7b1ab1.zip |
message: 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 5db5e7e527a41460ff9d9d631c6d011eb8d57a6e)
-rw-r--r-- | src/messages.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/messages.c b/src/messages.c index 8e88bcc3..b73aecd8 100644 --- a/src/messages.c +++ b/src/messages.c @@ -715,7 +715,7 @@ static ssh_buffer ssh_msg_userauth_build_digest(ssh_session session, ssh_string_get_char(algo), /* pubkey algorithm */ str); /* public key as a blob */ - ssh_string_free(str); + SSH_STRING_FREE(str); if (rc != SSH_OK) { ssh_set_error_oom(session); ssh_buffer_free(buffer); @@ -800,7 +800,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ * 3.1. Initial Exchange * "The language tag is deprecated and SHOULD be the empty string." */ - ssh_string_free(lang); + SSH_STRING_FREE(lang); submethods = ssh_buffer_get_ssh_string(packet); if (submethods == NULL) { @@ -812,7 +812,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ * server is that, unless the user may use multiple different * submethods, the server ignores this field." */ - ssh_string_free(submethods); + SSH_STRING_FREE(submethods); goto end; } @@ -835,10 +835,10 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ } rc = ssh_pki_import_pubkey_blob(pubkey_blob, &msg->auth_request.pubkey); - ssh_string_free(pubkey_blob); + SSH_STRING_FREE(pubkey_blob); pubkey_blob = NULL; if (rc < 0) { - ssh_string_free(algo); + SSH_STRING_FREE(algo); algo = NULL; goto error; } @@ -852,16 +852,16 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ if(sig_blob == NULL) { SSH_LOG(SSH_LOG_PACKET, "Invalid signature packet from peer"); msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_ERROR; - ssh_string_free(algo); + SSH_STRING_FREE(algo); algo = NULL; goto error; } digest = ssh_msg_userauth_build_digest(session, msg, service, algo); - ssh_string_free(algo); + SSH_STRING_FREE(algo); algo = NULL; if (digest == NULL) { - ssh_string_free(sig_blob); + SSH_STRING_FREE(sig_blob); SSH_LOG(SSH_LOG_PACKET, "Failed to get digest"); msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_WRONG; goto error; @@ -894,7 +894,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ ssh_buffer_get_len(digest)); } } - ssh_string_free(sig_blob); + SSH_STRING_FREE(sig_blob); ssh_buffer_free(digest); ssh_signature_free(sig); if (rc < 0) { @@ -909,7 +909,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){ msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_VALID; } - ssh_string_free(algo); + SSH_STRING_FREE(algo); goto end; } #ifdef WITH_GSSAPI @@ -1097,7 +1097,7 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_info_response){ goto error; } session->kbdint->answers[i] = ssh_string_to_char(tmp); - ssh_string_free(tmp); + SSH_STRING_FREE(tmp); if (session->kbdint->answers[i] == NULL) { ssh_set_error_oom(session); session->kbdint->nanswers = i; |