From: Remi Gacogne Date: Wed, 15 Sep 2021 08:15:52 +0000 (+0200) Subject: dnsdist: Handle exception raised in IOStateGuard's destructor X-Git-Tag: dnsdist-1.7.0-alpha1~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10724%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Handle exception raised in IOStateGuard's destructor Reported by Coverity (CID 372512). --- diff --git a/pdns/dnsdistdist/tcpiohandler-mplexer.hh b/pdns/dnsdistdist/tcpiohandler-mplexer.hh index 2fbe4b5147..d62ba7828b 100644 --- a/pdns/dnsdistdist/tcpiohandler-mplexer.hh +++ b/pdns/dnsdistdist/tcpiohandler-mplexer.hh @@ -187,7 +187,13 @@ public: and its reference count goes to zero */ if (d_enabled && d_handler) { DEBUGLOG("IOStateGuard destroyed while holding a state, let's reset it"); - d_handler->reset(); + try { + d_handler->reset(); + } + catch (const FDMultiplexerException& e) { + /* that should not happen, but an exception raised from a destructor would be bad so better + safe than sorry */ + } d_enabled = false; } }