mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +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");
|
size_t pubkeyPathLen = strlen(privkeyFile) + sizeof(".pub");
|
||||||
|
|
||||||
if (pubkey) {
|
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) {
|
if (rc == SSH_OK) {
|
||||||
configKeys[configKeysCount++] = pubkey;
|
configKeys[configKeysCount++] = pubkey;
|
||||||
} else if (pubkey) {
|
} else if (pubkey) {
|
||||||
ssh_key_free(pubkey);
|
SSH_KEY_FREE(pubkey);
|
||||||
}
|
}
|
||||||
free(pubkeyFile);
|
free(pubkeyFile);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user