--- sofia-sip-1.12.11.orig/libsofia-sip-ua/tport/tport_tls.c	2011-03-11 15:49:19.000000000 +0100
+++ sofia-sip-1.12.11/libsofia-sip-ua/tport/tport_tls.c	2012-12-18 17:38:45.000000000 +0100
@@ -396,15 +396,15 @@
   if (!tls)
     return;
 
-  if (tls->con != NULL)
+  if (tls->con != NULL) {
     SSL_shutdown(tls->con);
+    SSL_shutdown(tls->con);
+    SSL_free(tls->con);
+  }
 
   if (tls->ctx != NULL && tls->type != tls_slave)
     SSL_CTX_free(tls->ctx);
 
-  if (tls->bio_con != NULL)
-    BIO_free(tls->bio_con);
-
   su_home_unref(tls->home);
 }
 
@@ -472,7 +472,6 @@
 
   if (tls) {
     tls->ctx = master->ctx;
-    tls->type = master->type;
     tls->accept = accept ? 1 : 0;
     tls->verify_outgoing = master->verify_outgoing;
     tls->verify_incoming = master->verify_incoming;

Add patch to fix sofia TLS memory leak.
Add patch to fix sofia TLS memory leak.
