Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5949)

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 8392010: Fix use-after-free that resulted from r106949. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/tab_contents/spelling_menu_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.cc
===================================================================
--- chrome/browser/metrics/metrics_service.cc (revision 107151)
+++ chrome/browser/metrics/metrics_service.cc (working copy)
@@ -1072,7 +1072,8 @@
DCHECK(waiting_for_asynchronus_reporting_step_);
waiting_for_asynchronus_reporting_step_ = false;
DCHECK(current_fetch_.get());
- current_fetch_.reset(NULL); // We're not allowed to re-use it.
+ // We're not allowed to re-use it. Delete it on function exit since we use it.
+ scoped_ptr<content::URLFetcher> s(current_fetch_.release());
// Confirm send so that we can move on.
VLOG(1) << "METRICS RESPONSE CODE: " << source->GetResponseCode()
« no previous file with comments | « no previous file | chrome/browser/tab_contents/spelling_menu_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698