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:
12
src/auth.c
12
src/auth.c
@@ -748,13 +748,19 @@ int ssh_userauth_pubkey(ssh_session session, const char *username,
|
|||||||
ssh_string_free(pkstr);
|
ssh_string_free(pkstr);
|
||||||
|
|
||||||
sign = ssh_do_sign(session,session->out_buffer, privatekey);
|
sign = ssh_do_sign(session,session->out_buffer, privatekey);
|
||||||
if(sign == NULL)
|
if(sign == NULL) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
goto error;
|
leave_function();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer_add_ssh_string(session->out_buffer,sign) < 0) {
|
if (buffer_add_ssh_string(session->out_buffer,sign) < 0) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
goto error;
|
ssh_string_free(sign);
|
||||||
|
leave_function();
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_string_free(sign);
|
ssh_string_free(sign);
|
||||||
session->auth_state=SSH_AUTH_STATE_NONE;
|
session->auth_state=SSH_AUTH_STATE_NONE;
|
||||||
session->pending_call_state=SSH_PENDING_CALL_AUTH_PUBKEY;
|
session->pending_call_state=SSH_PENDING_CALL_AUTH_PUBKEY;
|
||||||
|
|||||||
Reference in New Issue
Block a user