mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
auth: Avoid double free
Fixes CID 1498359 Thanks coverity Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
@@ -967,7 +967,7 @@ int ssh_userauth_agent(ssh_session session,
|
||||
size_t pubkeyPathLen = strlen(privkeyFile) + sizeof(".pub");
|
||||
|
||||
if (pubkey) {
|
||||
ssh_key_free(pubkey);
|
||||
SSH_KEY_FREE(pubkey);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -985,7 +985,7 @@ int ssh_userauth_agent(ssh_session session,
|
||||
if (rc == SSH_OK) {
|
||||
configKeys[configKeysCount++] = pubkey;
|
||||
} else if (pubkey) {
|
||||
ssh_key_free(pubkey);
|
||||
SSH_KEY_FREE(pubkey);
|
||||
}
|
||||
free(pubkeyFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user