mirror of https://github.com/bjornbytes/lovr.git
Oops, use calloc in _lovrAlloc;
This commit is contained in:
parent
3aec7f7767
commit
f5a903a805
|
@ -29,7 +29,7 @@ void lovrThrow(const char* format, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void* _lovrAlloc(const char* type, size_t size, void (*destructor)(void*)) {
|
void* _lovrAlloc(const char* type, size_t size, void (*destructor)(void*)) {
|
||||||
Ref* ref = malloc(size);
|
Ref* ref = calloc(1, size);
|
||||||
lovrAssert(ref, "Out of memory");
|
lovrAssert(ref, "Out of memory");
|
||||||
ref->destructor = destructor;
|
ref->destructor = destructor;
|
||||||
ref->type = type;
|
ref->type = type;
|
||||||
|
|
Loading…
Reference in New Issue