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:
Jakub Jelen
2022-09-26 08:47:14 +02:00
parent 367be19990
commit 46b1f1091b

View File

@@ -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);
}