Commit 09f83fa8 authored by eroman@chromium.org's avatar eroman@chromium.org

Fix a leak of the new location GURL by NotificationTask when doing a redirect.

The problem is scoped_ptr<ResourceRequestDetails> is used to delete an instance of ResourceRedirectDetails, however the base class's destructor is non-virtual, so ResourceRedirectDetails extra field (GURL new_url_) does not get torn down properly.

Note that the blame callstacks in the bug report appear unrelated, because std::string is doing some fancy refcounting under the hood. So as GURLs get passed around, they take over the GURL::spec's memory that got allocated earlier by the network stack.

BUG=http://crbug.com/10873
TEST=The "RedirectTest.*" ui tests when run on linux valgrind bots should show no leaks

Review URL: http://codereview.chromium.org/155204

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20179 0039d316-1c4b-4281-b951-d872f2087c98
parent 20b29783
...@@ -41,7 +41,7 @@ class ResourceRequestDetails { ...@@ -41,7 +41,7 @@ class ResourceRequestDetails {
filter_policy_ = info->filter_policy; filter_policy_ = info->filter_policy;
} }
~ResourceRequestDetails() { } virtual ~ResourceRequestDetails() { }
const GURL& url() const { return url_; } const GURL& url() const { return url_; }
const GURL& original_url() const { return original_url_; } const GURL& original_url() const { return original_url_; }
......
...@@ -493,31 +493,6 @@ ...@@ -493,31 +493,6 @@
fun:_ZN14MetricsService17GetPluginListTask3RunEv fun:_ZN14MetricsService17GetPluginListTask3RunEv
fun:_ZN11MessageLoop7RunTaskEP4Task fun:_ZN11MessageLoop7RunTaskEP4Task
} }
{
# See http://crbug.com/10871
bug_10871
Memcheck:Leak
fun:_Znwj
fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
fun:_ZNSs4_Rep8_M_cloneERKSaIcEj
fun:_ZNSs7reserveEj
fun:_ZNK4GURL27ResolveWithCharsetConverterERKSsPN9url_canon16CharsetConverterE
fun:_ZNK4GURL7ResolveERKSs
fun:_ZN17URLRequestHttpJob18IsRedirectResponseEP4GURLPi
}
{
# See http://crbug.com/10873
bug_10873
Memcheck:Leak
fun:_Znwj
fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
fun:_ZNSs4_Rep8_M_cloneERKSaIcEj
fun:_ZNSs7reserveEj
fun:_ZNK4GURL17ReplaceComponentsERKN9url_canon12ReplacementsIcEE
fun:_ZN13URLRequestJob21NotifyHeadersCompleteEv
fun:_ZN17URLRequestHttpJob21NotifyHeadersCompleteEv
fun:_ZN17URLRequestHttpJob16OnStartCompletedEi
}
{ {
# See http://crbug.com/11116 # See http://crbug.com/11116
bug_11116a bug_11116a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment