Commit 462f20fa authored by xiyuan's avatar xiyuan Committed by Commit bot

Fix potential UAF in DriveAppConverter.

BUG=480941

Review URL: https://codereview.chromium.org/1105193002

Cr-Commit-Position: refs/heads/master@{#327428}
parent 0157b3db
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <algorithm> #include <algorithm>
#include <set> #include <set>
#include "base/callback_helpers.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
...@@ -110,7 +111,7 @@ void DriveAppConverter::Start() { ...@@ -110,7 +111,7 @@ void DriveAppConverter::Start() {
if (drive_app_info_.app_name.empty() || if (drive_app_info_.app_name.empty() ||
!drive_app_info_.create_url.is_valid()) { !drive_app_info_.create_url.is_valid()) {
finished_callback_.Run(this, false); base::ResetAndReturn(&finished_callback_).Run(this, false);
return; return;
} }
...@@ -198,6 +199,6 @@ void DriveAppConverter::OnFinishCrxInstall(const std::string& extension_id, ...@@ -198,6 +199,6 @@ void DriveAppConverter::OnFinishCrxInstall(const std::string& extension_id,
is_new_install_ = success && crx_installer_->current_version().empty(); is_new_install_ = success && crx_installer_->current_version().empty();
PostInstallCleanUp(); PostInstallCleanUp();
finished_callback_.Run(this, success); base::ResetAndReturn(&finished_callback_).Run(this, success);
// |finished_callback_| could delete this. // |finished_callback_| could delete this.
} }
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