1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

auth: Fixed a double free error.

This commit is contained in:
Andreas Schneider
2011-02-13 10:43:59 +01:00
parent d1ddec00d9
commit 499467d362

View File

@@ -748,13 +748,19 @@ int ssh_userauth_pubkey(ssh_session session, const char *username,
ssh_string_free(pkstr);
sign = ssh_do_sign(session,session->out_buffer, privatekey);
if(sign == NULL)
if(sign == NULL) {
ssh_set_error_oom(session);
goto error;
leave_function();
return rc;
}
if (buffer_add_ssh_string(session->out_buffer,sign) < 0) {
ssh_set_error_oom(session);
goto error;
ssh_string_free(sign);
leave_function();
return rc;
}
ssh_string_free(sign);
session->auth_state=SSH_AUTH_STATE_NONE;
session->pending_call_state=SSH_PENDING_CALL_AUTH_PUBKEY;