auth: Avoid memory on error in ssh_userauth_agent_publickey()

CID 1401095

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
Andreas Schneider
2019-04-30 08:03:25 +02:00
parent db8aca69a7
commit ee82bab801

View File

@@ -757,6 +757,7 @@ static int ssh_userauth_agent_publickey(ssh_session session,
if (sig_type_c == NULL) {
ssh_set_error(session, SSH_REQUEST_DENIED,
"Invalid key type (unknown)");
SSH_STRING_FREE(pubkey_s);
return SSH_AUTH_DENIED;
}
if (!ssh_key_algorithm_allowed(session, sig_type_c)) {