fix for realloc with size 0: returning NULL from realloc now always indicates an error (issue #574)

This commit is contained in:
Daan Leijen 2022-04-19 10:31:55 -07:00
parent 8713959498
commit a158aef235
2 changed files with 11 additions and 2 deletions

View file

@ -198,6 +198,12 @@ int main(void) {
mi_free(q);
};
CHECK_BODY("reallocarray-null-sizezero") {
void* p = mi_reallocarray(NULL,0,16); // issue #574
result = (p != NULL && errno == 0);
mi_free(p);
};
// ---------------------------------------------------
// Heaps
// ---------------------------------------------------