Merge "fix mmap leak of graphicsstats service"

This commit is contained in:
Treehugger Robot
2019-01-08 05:03:47 +00:00
committed by Gerrit Code Review

View File

@@ -139,6 +139,7 @@ bool GraphicsStatsService::parseFromFile(const std::string& path,
uint32_t file_version = *reinterpret_cast<uint32_t*>(addr);
if (file_version != sCurrentFileVersion) {
ALOGW("file_version mismatch! expected %d got %d", sCurrentFileVersion, file_version);
munmap(addr, sb.st_size);
return false;
}
@@ -150,6 +151,7 @@ bool GraphicsStatsService::parseFromFile(const std::string& path,
ALOGW("Parse failed on '%s' error='%s'", path.c_str(),
output->InitializationErrorString().c_str());
}
munmap(addr, sb.st_size);
return success;
}