mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-13 02:48:23 +00:00
[client/common] fixes for issues detected through static analysis.
This commit is contained in:
@@ -42,6 +42,12 @@ RingBuffer ringbuffer_newInternal(int length, size_t valueSize,
|
||||
DEBUG_ASSERT(valueSize > 0 && valueSize < UINT32_MAX);
|
||||
|
||||
struct RingBuffer * rb = calloc(1, sizeof(*rb) + valueSize * length);
|
||||
if (!rb)
|
||||
{
|
||||
DEBUG_ERROR("out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rb->length = length;
|
||||
rb->valueSize = valueSize;
|
||||
atomic_store(&rb->readPos , 0);
|
||||
|
Reference in New Issue
Block a user