summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpanayiotis@google.com <panayiotis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 18:37:40 +0000
committerpanayiotis@google.com <panayiotis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 18:37:40 +0000
commitba639cb4bdf8d76764c87fcf8ad107f73f8437a6 (patch)
tree4414f3a46938194a5e174c1936458d7755fcfc15 /chrome
parent404dd0018749fd5b3e61bc87ace8515788ee3012 (diff)
downloadchromium_src-ba639cb4bdf8d76764c87fcf8ad107f73f8437a6.zip
chromium_src-ba639cb4bdf8d76764c87fcf8ad107f73f8437a6.tar.gz
chromium_src-ba639cb4bdf8d76764c87fcf8ad107f73f8437a6.tar.bz2
Fix memory leak in the malware_details unittest.
BUG=66277 TEST=unit_tests with valgrind Review URL: http://codereview.chromium.org/5707004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/safe_browsing/malware_details_unittest.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc
index 85b2d45..b6136c8 100644
--- a/chrome/browser/safe_browsing/malware_details_unittest.cc
+++ b/chrome/browser/safe_browsing/malware_details_unittest.cc
@@ -94,7 +94,8 @@ TEST_F(MalwareDetailsTest, MalwareSubResource) {
SafeBrowsingService::UnsafeResource resource;
InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
- MalwareDetails* report = new MalwareDetails(contents(), resource);
+ scoped_refptr<MalwareDetails> report = new MalwareDetails(
+ contents(), resource);
scoped_ptr<const std::string> serialized(report->GetSerializedReport());
safe_browsing::ClientMalwareReportRequest actual;
@@ -123,7 +124,8 @@ TEST_F(MalwareDetailsTest, MalwareSubResourceWithOriginalUrl) {
InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
resource.original_url = GURL(kOriginalLandingURL);
- MalwareDetails* report = new MalwareDetails(contents(), resource);
+ scoped_refptr<MalwareDetails> report = new MalwareDetails(
+ contents(), resource);
scoped_ptr<const std::string> serialized(report->GetSerializedReport());
safe_browsing::ClientMalwareReportRequest actual;
@@ -154,7 +156,8 @@ TEST_F(MalwareDetailsTest, NotPublicUrl) {
controller().LoadURL(GURL(kHttpsURL), GURL(), PageTransition::TYPED);
SafeBrowsingService::UnsafeResource resource;
InitResource(&resource, ResourceType::SUB_RESOURCE, GURL(kMalwareURL));
- MalwareDetails* report = new MalwareDetails(contents(), resource);
+ scoped_refptr<MalwareDetails> report = new MalwareDetails(
+ contents(), resource);
scoped_ptr<const std::string> serialized(report->GetSerializedReport());
safe_browsing::ClientMalwareReportRequest actual;