Check that full() in udf_buffer is not empty and assert (#1753)

This commit is contained in:
Wesley Shillingford 2019-02-22 10:31:54 +00:00 committed by GitHub
commit a0369e38d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3853,12 +3853,13 @@ nano::udp_data * nano::udp_buffer::allocate ()
result = free.front ();
free.pop_front ();
}
if (result == nullptr)
if (result == nullptr && !full.empty ())
{
result = full.front ();
full.pop_front ();
stats.inc (nano::stat::type::udp, nano::stat::detail::overflow, nano::stat::dir::in);
}
release_assert (result || stopped);
return result;
}
void nano::udp_buffer::enqueue (nano::udp_data * data_a)