From 028f0bdb8ddc5394322f535048060ce8dce08eac Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 25 Aug 2017 14:45:58 -0400 Subject: [PATCH] Fixed #931. don't insert null pointer into DHkeys list --- libi2pd/Transports.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libi2pd/Transports.cpp b/libi2pd/Transports.cpp index b531bf71..f375296f 100644 --- a/libi2pd/Transports.cpp +++ b/libi2pd/Transports.cpp @@ -102,9 +102,14 @@ namespace transport void DHKeysPairSupplier::Return (std::shared_ptr pair) { - std::unique_lockl(m_AcquiredMutex); - if ((int)m_Queue.size () < 2*m_QueueSize) - m_Queue.push (pair); + if (pair) + { + std::unique_lockl(m_AcquiredMutex); + if ((int)m_Queue.size () < 2*m_QueueSize) + m_Queue.push (pair); + } + else + LogPrint(eLogError, "Transports: return null DHKeys"); } Transports transports;