Bug 1730379 - Check mmap return value in ScopedMMap constructor. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D125335
This commit is contained in:
Alex Henrie 2021-09-20 19:29:39 +00:00
parent 393eadce50
commit 210903b7e5

View File

@ -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) {