aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-13 10:43:59 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-13 10:43:59 +0100
commit499467d362021a147c9ea3d5083881feb2e42696 (patch)
tree6f3971db8690d4a5138b538830d8b0630556ca8d
parentd1ddec00d99e96009eebead8e1263efcfe80f9ee (diff)
downloadlibssh-499467d362021a147c9ea3d5083881feb2e42696.tar.gz
libssh-499467d362021a147c9ea3d5083881feb2e42696.tar.xz
libssh-499467d362021a147c9ea3d5083881feb2e42696.zip
auth: Fixed a double free error.
-rw-r--r--src/auth.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/auth.c b/src/auth.c
index 8327a17..e0b3a7d 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -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;