mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1730379 - Check mmap return value in ScopedMMap constructor. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D125335
This commit is contained in:
parent
393eadce50
commit
210903b7e5
@ -274,6 +274,9 @@ class ScopedMMap {
|
||||
}
|
||||
size = st.st_size;
|
||||
buf = (char*)mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
if (buf == MAP_FAILED) {
|
||||
buf = nullptr;
|
||||
}
|
||||
}
|
||||
~ScopedMMap() {
|
||||
if (buf) {
|
||||
|
Loading…
Reference in New Issue
Block a user