diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index d9d974df..83682a51 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -84,6 +84,7 @@ class MockMinidumpUnloadedModuleList : public MinidumpUnloadedModuleList { public: MockMinidumpUnloadedModuleList() : MinidumpUnloadedModuleList(NULL) {} + ~MockMinidumpUnloadedModuleList() {} MOCK_CONST_METHOD0(Copy, CodeModules*()); MOCK_CONST_METHOD1(GetModuleForAddress, const MinidumpUnloadedModule*(uint64_t)); @@ -400,11 +401,13 @@ TEST_F(MinidumpProcessorTest, TestUnloadedModules) { EXPECT_CALL(memory_list, GetMemoryRegionForAddress(_)). Times(0); + MockMinidumpUnloadedModuleList* unloaded_module_list_copy = + new MockMinidumpUnloadedModuleList(); EXPECT_CALL(unloaded_module_list, Copy()). - WillOnce(Return(&unloaded_module_list)); + WillOnce(Return(unloaded_module_list_copy)); MockMinidumpUnloadedModule unloaded_module; - EXPECT_CALL(unloaded_module_list, GetModuleForAddress(kExpectedEIP)). + EXPECT_CALL(*unloaded_module_list_copy, GetModuleForAddress(kExpectedEIP)). WillOnce(Return(&unloaded_module)); MinidumpProcessor processor(reinterpret_cast(NULL), NULL); diff --git a/src/processor/process_state.cc b/src/processor/process_state.cc index 90ae93d7..43c4a4b8 100644 --- a/src/processor/process_state.cc +++ b/src/processor/process_state.cc @@ -64,6 +64,7 @@ void ProcessState::Clear() { modules_with_corrupt_symbols_.clear(); delete modules_; modules_ = NULL; + delete unloaded_modules_; unloaded_modules_ = NULL; }