diff options
author | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-28 00:24:39 +0000 |
---|---|---|
committer | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-28 00:24:39 +0000 |
commit | fb78fa24b95053751f7343cecf69e175829f119f (patch) | |
tree | 4a675acbd68f003e9d8b4e3a87ada27656bf1f7a | |
parent | f70559cfae677cc0c14c61a9357b90022d21c294 (diff) | |
download | chromium_src-fb78fa24b95053751f7343cecf69e175829f119f.zip chromium_src-fb78fa24b95053751f7343cecf69e175829f119f.tar.gz chromium_src-fb78fa24b95053751f7343cecf69e175829f119f.tar.bz2 |
Fix memory leak in HidServiceTest.Create from r285774
To fix tree-closer in Linux ASan LSan Tests (1) since
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/4338
errors like
Direct leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x44145b in operator new(unsigned long) /usr/local/google/work/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:55
#1 0x5e8afd in device::HidService::Create(scoped_refptr\u003Cbase::MessageLoopProxy>) device/hid/hid_service.cc:26
#2 0x509324 in device::HidServiceTest_Create_Test::TestBody() device/hid/hid_service_unittest.cc:15
BUG=367145
NOTRY=true
NOTREECHECKS=true
TBR=rockot@chromium.org
Review URL: https://codereview.chromium.org/424623002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285848 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | device/hid/hid_service_unittest.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/device/hid/hid_service_unittest.cc b/device/hid/hid_service_unittest.cc index 7636e71..a807579 100644 --- a/device/hid/hid_service_unittest.cc +++ b/device/hid/hid_service_unittest.cc @@ -4,6 +4,7 @@ #include <vector> +#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "device/hid/hid_service.h" #include "testing/gtest/include/gtest/gtest.h" @@ -12,7 +13,8 @@ namespace device { TEST(HidServiceTest, Create) { base::MessageLoopForIO message_loop; - HidService* service = HidService::Create(message_loop.message_loop_proxy()); + scoped_ptr<HidService> service( + HidService::Create(message_loop.message_loop_proxy())); ASSERT_TRUE(service); std::vector<HidDeviceInfo> devices; |