From 21b9693bd250e09ea9dfce3db5cae0bff5b1e9cf Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Mon, 14 Mar 2011 21:20:42 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40955 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp index 15dc194e10..e856b729fd 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -111,6 +111,12 @@ POP3Protocol::Disconnect() 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 @@ POP3Protocol::Disconnect() #else closesocket(fSocket); #endif + fSocket = -1; return B_OK; }