aboutsummaryrefslogtreecommitdiff
path: root/src/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth.c')
-rw-r--r--src/auth.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/auth.c b/src/auth.c
index ac6c9b14..89272290 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -1132,7 +1132,9 @@ int ssh_userauth_publickey_auto(ssh_session session,
"Public key authentication error for %s",
privkey_file);
ssh_key_free(state->privkey);
+ state->privkey = NULL;
ssh_key_free(state->pubkey);
+ state->pubkey = NULL;
SAFE_FREE(session->auth.auto_state);
return rc;
} else if (rc == SSH_AUTH_AGAIN) {
@@ -1198,6 +1200,9 @@ int ssh_userauth_publickey_auto(ssh_session session,
return rc;
}
+ ssh_key_free(state->privkey);
+ ssh_key_free(state->pubkey);
+
SSH_LOG(SSH_LOG_WARN,
"The server accepted the public key but refused the signature");
state->it = state->it->next;