[haiku-commits] r40955 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 14 Mar 2011 22:20:42 +0100 (CET)

Author: czeidler
Date: 2011-03-14 22:20:42 +0100 (Mon, 14 Mar 2011)
New Revision: 40955
Changeset: http://dev.haiku-os.org/changeset/40955
Ticket: http://dev.haiku-os.org/ticket/7365

Modified:
   haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp
Log:
Clear variables after free them. Don't leak fSSLBio. Should help a bit for 
#7365. Note: the IMAP ServerConnection should be reused for POP3 and SMTP.



Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp
===================================================================
--- haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp 
2011-03-14 20:21:38 UTC (rev 40954)
+++ haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp 
2011-03-14 21:20:42 UTC (rev 40955)
@@ -111,6 +111,12 @@
                        SSL_shutdown(fSSL);
                if (fSSLContext)
                        SSL_CTX_free(fSSLContext);
+               if (fSSLBio)
+                       BIO_free(fSSLBio);
+
+               fSSL = NULL;
+               fSSLContext = NULL;
+               fSSLBio = NULL;
        }
 #endif
 
@@ -119,6 +125,7 @@
 #else
        closesocket(fSocket);
 #endif
+       fSocket = -1;
        return B_OK;
 }
 


Other related posts:

  • » [haiku-commits] r40955 - haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/pop3 - clemens . zeidler