Set heap size to 0 when heap allocation fails

This commit is contained in:
Jeff Epler 2022-07-13 13:53:22 -05:00
parent c1b6c367ff
commit 09d1c846c4
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 1 additions and 0 deletions

View File

@ -235,6 +235,7 @@ safe_mode_t port_init(void) {
heap_size = HEAP_SIZE / sizeof(uint32_t);
}
if (heap == NULL) {
heap_size = 0;
return NO_HEAP;
}