Check return value of memory_map_fixed()

All other calls to memory_map_fixed() are checked, and this one may also
theoretically fail.
This commit is contained in:
Thibaut Sautereau 2021-02-10 09:18:26 +01:00
parent 5c8b686370
commit 4a5b3a33b9
No known key found for this signature in database
GPG key ID: AFB95DA3B1D60262

View file

@ -903,7 +903,10 @@ static int regions_grow(void) {
}
}
memory_map_fixed(ra->regions, ra->total * sizeof(struct region_metadata));
if (memory_map_fixed(ra->regions, ra->total * sizeof(struct region_metadata))) {
return 1;
}
memory_set_name(ra->regions, ra->total * sizeof(struct region_metadata), "malloc allocator_state");
ra->free = ra->free + ra->total;
ra->total = newtotal;