From 707f64b85c8a1b88923617ff72bd8a4ca562f3bd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Dec 2009 15:09:55 +0100 Subject: prevent destructors from throwing exceptions; check curl_easy_init errors Signed-off-by: Denys Vlasenko --- src/CLI/ABRTSocket.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/CLI/ABRTSocket.cpp b/src/CLI/ABRTSocket.cpp index d31c7a4..1353134 100644 --- a/src/CLI/ABRTSocket.cpp +++ b/src/CLI/ABRTSocket.cpp @@ -13,7 +13,17 @@ CABRTSocket::CABRTSocket() : m_nSocket(-1) CABRTSocket::~CABRTSocket() { - Disconnect(); + /* Paranoia. In C++, destructor will abort() if it was called while unwinding + * the stack and it throws an exception. + */ + try + { + Disconnect(); + } + catch (...) + { + error_msg_and_die("Internal error"); + } } void CABRTSocket::Send(const std::string& pMessage) -- cgit