aboutsummaryrefslogtreecommitdiff
path: root/src/gssapi.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-07-14 14:17:03 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-14 15:01:52 +0200
commitb4790fbdd2de674bfa6eb971533bfad857d5da26 (patch)
tree5d303b0139fbffddf45f29cc420893d0ce9c2f34 /src/gssapi.c
parentdf373efc5688b6c320316d30b5f4398d37f4fe61 (diff)
downloadlibssh-b4790fbdd2de674bfa6eb971533bfad857d5da26.tar.gz
libssh-b4790fbdd2de674bfa6eb971533bfad857d5da26.tar.xz
libssh-b4790fbdd2de674bfa6eb971533bfad857d5da26.zip
gssapi: Fix a memory leak.
CID #0
Diffstat (limited to 'src/gssapi.c')
-rw-r--r--src/gssapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gssapi.c b/src/gssapi.c
index 23a9c1aa..97035588 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -773,7 +773,7 @@ static int ssh_gssapi_send_mic(ssh_session session){
SSH_LOG(SSH_LOG_PACKET,"Sending SSH_MSG_USERAUTH_GSSAPI_MIC");
mic_buffer = ssh_gssapi_build_mic(session);
- if(!mic_buffer){
+ if (mic_buffer == NULL) {
ssh_set_error_oom(session);
return SSH_ERROR;
}
@@ -789,6 +789,8 @@ static int ssh_gssapi_send_mic(ssh_session session){
buffer_add_u8(session->out_buffer, SSH2_MSG_USERAUTH_GSSAPI_MIC);
buffer_add_u32(session->out_buffer, htonl(mic_token_buf.length));
buffer_add_data(session->out_buffer, mic_token_buf.value, mic_token_buf.length);
+ ssh_buffer_free(mic_buffer);
+
return packet_send(session);
}