From 81279958c846dda81b9c76f1059481b24b4463dc Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Sat, 25 Feb 2017 23:22:19 -0500
Subject: [PATCH] sip: fix exception during class destructor

~SIPVoIPLink() calls handleEvents() but this method may throw.
Throwing during destructor is forbidden and result to and std::terminate().
Fix by try {} catch the call.

Detected by Coverity scan.

Change-Id: I57d742c7f6b6d872b4b2118c1f10c0986c082397
---
 src/sip/sipvoiplink.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sip/sipvoiplink.cpp b/src/sip/sipvoiplink.cpp
index c9288b75af..548b91ba2d 100644
--- a/src/sip/sipvoiplink.cpp
+++ b/src/sip/sipvoiplink.cpp
@@ -609,7 +609,9 @@ SIPVoIPLink::~SIPVoIPLink()
 
     pjsip_tpmgr_set_state_cb(pjsip_endpt_get_tpmgr(endpt_), nullptr);
     Manager::instance().unregisterEventHandler((uintptr_t)this);
-    handleEvents();
+    try {
+        handleEvents();
+    } catch (...) {}
 
     sipTransportBroker.reset();
 
-- 
GitLab