mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
auth: Fix a memory leak in ssh_userauth_agent_publickey()
CID 1230358 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user