aboutsummaryrefslogtreecommitdiff
path: root/src/auth.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-01 09:32:35 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-01 09:41:11 +0200
commitea2b403ab236b3b8f895f9affbc8f162ee61ddb2 (patch)
tree1e5802d795a473d5c549059208a7d562728ae266 /src/auth.c
parent8323cd791f792b27d2717c24859d78e8f2faf555 (diff)
downloadlibssh-ea2b403ab236b3b8f895f9affbc8f162ee61ddb2.tar.gz
libssh-ea2b403ab236b3b8f895f9affbc8f162ee61ddb2.tar.xz
libssh-ea2b403ab236b3b8f895f9affbc8f162ee61ddb2.zip
auth: Fix a memory leak in ssh_userauth_agent_publickey()
CID 1230358 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/auth.c b/src/auth.c
index c1bb2cc5..f72c4373 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -729,6 +729,7 @@ static int ssh_userauth_agent_publickey(ssh_session session,
"The key algorithm '%s' is not allowed to be used by"
" PUBLICKEY_ACCEPTED_TYPES configuration option",
sig_type_c);
+ ssh_string_free(str);
return SSH_AUTH_DENIED;
}
@@ -742,12 +743,11 @@ static int ssh_userauth_agent_publickey(ssh_session session,
sig_type_c, /* algo */
str /* public key */
);
+ ssh_string_free(str);
if (rc < 0) {
goto fail;
}
- ssh_string_free(str);
-
/* sign the buffer with the private key */
str = ssh_pki_do_sign_agent(session, session->out_buffer, pubkey);
if (str == NULL) {