[hotssh] gssh: Free libssh connection on dispose



commit 2445e0b1cddb4b1b770dacb56b6060171e13e920
Author: Colin Walters <walters verbum org>
Date:   Thu Dec 5 08:50:45 2013 -0500

    gssh: Free libssh connection on dispose

 libgssh/gssh-connection.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libgssh/gssh-connection.c b/libgssh/gssh-connection.c
index 33e1aae..48de946 100644
--- a/libgssh/gssh-connection.c
+++ b/libgssh/gssh-connection.c
@@ -93,6 +93,12 @@ reset_state (GSshConnection               *self)
   g_clear_object (&self->socket);
   if (self->socket_source)
     g_source_destroy (self->socket_source);
+  if (self->session)
+    {
+      ssh_disconnect (self->session); 
+      ssh_free (self->session);
+      self->session = NULL;
+    }
   g_clear_pointer (&self->socket_source, g_source_unref);
   g_clear_pointer (&self->authmechanisms, g_array_unref);
   g_clear_pointer (&self->password, g_free);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]