Fix a possible crash when calling AdapterRequestJob::Kill().
authorCheng Zhao <zcbenz@gmail.com>
Tue, 22 Oct 2013 01:33:38 +0000 (09:33 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 22 Oct 2013 01:33:38 +0000 (09:33 +0800)
browser/net/adapter_request_job.cc

index 1244922..7dea112 100644 (file)
@@ -30,8 +30,8 @@ void AdapterRequestJob::Start() {
 }
 
 void AdapterRequestJob::Kill() {
-  DCHECK(real_job_);
-  real_job_->Kill();
+  if (real_job_)  // Kill could happen when real_job_ is created.
+    real_job_->Kill();
 }
 
 bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf,