When calling BacktraceMap::Create(), a NULL pointer is returned if Build
fails. Building twice can cause problems and might leak memory.
Change-Id: I38a4100e534ef15a19883703aa504e795a14b6de
uintptr_t end,
std::string* error_msg) {
std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
- if (!map->Build()) {
+ if (map.get() == nullptr) {
*error_msg = StringPrintf("Failed to build process map");
return false;
}
uintptr_t end,
std::string* error_msg) {
std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
- if (!map->Build()) {
+ if (map.get() == nullptr) {
*error_msg = StringPrintf("Failed to build process map");
return false;
}