diff options
author | Vincent Richard <[email protected]> | 2007-08-10 09:04:18 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2007-08-10 09:04:18 +0000 |
commit | 80663945388669b8123b1c3411afdb108e6aea22 (patch) | |
tree | 234e65305b7431cd6394df56ee5c131e206f984d | |
parent | Fixed bug in modified UTF-7 encoding. (diff) | |
download | vmime-80663945388669b8123b1c3411afdb108e6aea22.tar.gz vmime-80663945388669b8123b1c3411afdb108e6aea22.zip |
Reset exception pointer (thanks to Emmanuel Cabestan).
-rw-r--r-- | src/net/tls/TLSSocket.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp index 06736677..cc922796 100644 --- a/src/net/tls/TLSSocket.cpp +++ b/src/net/tls/TLSSocket.cpp @@ -355,7 +355,7 @@ ref <security::cert::certificateChain> TLSSocket::getPeerCertificates() const // C and C++ calls. // // gnutls_record_recv() calls TLSSocket::gnutlsPullFunc, and exceptions -// thrown by the socket can not not catched. +// thrown by the socket can not be caught. #ifndef VMIME_BUILDING_DOC @@ -380,10 +380,15 @@ void TLSSocket::internalThrow() if (m_ex) { + // Reset the current exception pointer to prevent the same + // exception from being thrown again later + exception* ex = m_ex; + m_ex = NULL; + // To avoid memory leaks - exToDelete.push_back(vmime::create <TLSSocket_DeleteExWrapper>(m_ex)); + exToDelete.push_back(vmime::create <TLSSocket_DeleteExWrapper>(ex)); - throw *m_ex; + throw *ex; } } |