From ba639cb4bdf8d76764c87fcf8ad107f73f8437a6 Mon Sep 17 00:00:00 2001 From: "panayiotis@google.com" Date: Mon, 13 Dec 2010 18:37:40 +0000 Subject: 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 --- chrome/browser/safe_browsing/malware_details_unittest.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'chrome/browser/safe_browsing') 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 report = new MalwareDetails( + contents(), resource); scoped_ptr 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 report = new MalwareDetails( + contents(), resource); scoped_ptr 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 report = new MalwareDetails( + contents(), resource); scoped_ptr serialized(report->GetSerializedReport()); safe_browsing::ClientMalwareReportRequest actual; -- cgit v1.1