mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
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:
parent
5c8b686370
commit
4a5b3a33b9
1 changed files with 4 additions and 1 deletions
|
@ -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");
|
memory_set_name(ra->regions, ra->total * sizeof(struct region_metadata), "malloc allocator_state");
|
||||||
ra->free = ra->free + ra->total;
|
ra->free = ra->free + ra->total;
|
||||||
ra->total = newtotal;
|
ra->total = newtotal;
|
||||||
|
|
Loading…
Add table
Reference in a new issue