[client/common] fixes for issues detected through static analysis.
This commit is contained in:
1 parent
a3820536ab
commit
3a8cb6a613
18 files changed
+228
-24
No files matched your search
@@ -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