mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 02:42:09 +00:00
mem: fix rare crash/logic error in heap allocation code
This commit is contained in:
parent
c790d03693
commit
0f2855ada8
1 changed files with 2 additions and 1 deletions
|
@ -976,13 +976,14 @@ namespace ams::mem::impl::heap {
|
|||
return span;
|
||||
}
|
||||
} else {
|
||||
const size_t prev_pages = span->num_pages;
|
||||
|
||||
Span *new_span = this->AllocateSpanStruct();
|
||||
if (new_span == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
auto new_span_guard = SCOPE_GUARD { this->FreeSpanToSpanPage(new_span); };
|
||||
|
||||
const size_t prev_pages = span->num_pages;
|
||||
span = GetSpanFromPointer(std::addressof(this->span_table), span->start.p);
|
||||
const size_t found_pages = span->num_pages;
|
||||
|
||||
|
|
Loading…
Reference in a new issue