aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-01-09 22:27:55 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2011-01-09 22:27:55 +0100
commitac6278feb7f4d16dad434a6eafefbecbe4ab0463 (patch)
tree90cadf7c81c02f70e0a427e1110ef30eac33e8c7 /src
parentd1e1103198f111a0f501c15480b81162b9f77a42 (diff)
downloadlibssh-ac6278feb7f4d16dad434a6eafefbecbe4ab0463.tar.gz
libssh-ac6278feb7f4d16dad434a6eafefbecbe4ab0463.tar.xz
libssh-ac6278feb7f4d16dad434a6eafefbecbe4ab0463.zip
Fix leak when key exchange fails.
Diffstat (limited to 'src')
-rw-r--r--src/session.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/session.c b/src/session.c
index a057b930..ef76d9f5 100644
--- a/src/session.c
+++ b/src/session.c
@@ -175,6 +175,10 @@ void ssh_free(ssh_session session) {
#endif
ssh_buffer_free(session->in_buffer);
ssh_buffer_free(session->out_buffer);
+ if(session->in_hashbuf != NULL)
+ ssh_buffer_free(session->in_hashbuf);
+ if(session->out_hashbuf != NULL)
+ ssh_buffer_free(session->out_hashbuf);
session->in_buffer=session->out_buffer=NULL;
crypto_free(session->current_crypto);
crypto_free(session->next_crypto);