mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
fix for realloc with size 0: returning NULL from realloc now always indicates an error (issue #574)
This commit is contained in:
parent
8713959498
commit
a158aef235
2 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
// ---------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue