Avoid zero-length calloc (#3280)
Using `calloc` function with a count of zero elements is implementation defined and it may cause allocation errors on some platforms (ref #3277). This commit fixes `jv_mem_calloc` callers to avoid undefined behavior.
This commit is contained in:
1 parent
4003202ccf
commit
a8ce2ff09a
6 files changed
+28
-7
No files matched your search
@@ -2,7 +2,6 @@
|
||||
#define JV_ALLOC_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "jv.h"
|
||||
|
||||
void* jv_mem_alloc(size_t);
|
||||
void* jv_mem_alloc_unguarded(size_t);
|
||||
|
||||
Reference in new issue
Block a user