From bcc4c172e4cc0de9788066fceff93c375c918372 Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Wed, 28 Sep 2016 12:08:52 -0400
Subject: [PATCH] ringdht: fix segfault due to nullptr access

remove a nullptr access when a call is cancelled during
the ICE initialization of an outgoing call.

Change-Id: I5dc27077b7054ba8c9c0716a4d05013f6a84530c
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
---
 src/ringdht/ringaccount.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp
index 8b6a26ce61..baa24b5dc5 100644
--- a/src/ringdht/ringaccount.cpp
+++ b/src/ringdht/ringaccount.cpp
@@ -195,11 +195,8 @@ RingAccount::newOutgoingCall(const std::string& toUrl)
     std::weak_ptr<SIPCall> weak_call = call;
     manager.addTask([shared_this, weak_call, toUri] {
         auto call = weak_call.lock();
-
-        if (not call) {
-            call->onFailure();
+        if (not call)
             return false;
-        }
 
         // Create an ICE transport for SIP channel
         std::shared_ptr<IceTransport> ice {};
-- 
GitLab