mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:44:15 +00:00
Fixed #931. don't insert null pointer into DHkeys list
This commit is contained in:
parent
1607535416
commit
028f0bdb8d
@ -102,9 +102,14 @@ namespace transport
|
|||||||
|
|
||||||
void DHKeysPairSupplier::Return (std::shared_ptr<i2p::crypto::DHKeys> pair)
|
void DHKeysPairSupplier::Return (std::shared_ptr<i2p::crypto::DHKeys> pair)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex>l(m_AcquiredMutex);
|
if (pair)
|
||||||
if ((int)m_Queue.size () < 2*m_QueueSize)
|
{
|
||||||
m_Queue.push (pair);
|
std::unique_lock<std::mutex>l(m_AcquiredMutex);
|
||||||
|
if ((int)m_Queue.size () < 2*m_QueueSize)
|
||||||
|
m_Queue.push (pair);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LogPrint(eLogError, "Transports: return null DHKeys");
|
||||||
}
|
}
|
||||||
|
|
||||||
Transports transports;
|
Transports transports;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user