session CHANGE tls/ssh-specific session field reorganized
diff --git a/src/session.c b/src/session.c
index bef3cd2..3306c07 100644
--- a/src/session.c
+++ b/src/session.c
@@ -308,12 +308,12 @@
 
 #ifdef ENABLE_TLS
     case NC_TI_OPENSSL:
-        X509_free(session->cert);
-
         if (connected) {
             SSL_shutdown(session->ti.tls);
         }
         SSL_free(session->ti.tls);
+
+        X509_free(session->tls_cert);
         break;
 #endif
     case NC_TI_NONE: