From 2b3595d0fe056ec4245ad3177d56c1e92da1ff9e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 15 Nov 2018 13:51:54 +0000 Subject: various: do not propagate exception through dtor Coverity 189689, 189690, 189692, 189695 --- src/common/http_connection.h | 3 ++- src/wallet/wallet2.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/common/http_connection.h b/src/common/http_connection.h index 9fc6be261..554dd832b 100644 --- a/src/common/http_connection.h +++ b/src/common/http_connection.h @@ -55,7 +55,8 @@ public: { if (m_ok) { - mp_http_client->disconnect(); + try { mp_http_client->disconnect(); } + catch (...) { /* do not propagate through dtor */ } } } diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6f919d12c..0eda7f52d 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -815,7 +815,12 @@ wallet_keys_unlocker::~wallet_keys_unlocker() { if (!locked) return; - w.encrypt_keys(key); + try { w.encrypt_keys(key); } + catch (...) + { + MERROR("Failed to re-encrypt wallet keys"); + // do not propagate through dtor, we'd crash + } } wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended): -- cgit v1.2.3