Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=mahe
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 19 Aug 2015 18:26:13 +0100
changeset 222377 b76c8843149c98e5bf63704e8e002a188a2608a6
parent 222376 b4135ecf90a3aca815098197f8426621dbe282cc
child 222378 b272be44ac173300bbaca1950c94c4619986cb3e
push id240
push userryanvm@gmail.com
push dateTue, 01 Sep 2015 02:40:06 +0000
treeherdermozilla-b2g34_v2_1s@71aa93494a06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, mahe
bugs1192350
milestone34.0
Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=mahe
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1945,16 +1945,22 @@ XMLHttpRequest::Open(const nsACString& a
     if (!--mProxy->mOpenCount) {
       ReleaseProxy();
     }
 
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
+  // We have been released in one of the nested Open() calls.
+  if (!mProxy) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return;
+  }
+
   --mProxy->mOpenCount;
   mProxy->mIsSyncXHR = !aAsync;
 }
 
 void
 XMLHttpRequest::SetRequestHeader(const nsACString& aHeader,
                                  const nsACString& aValue, ErrorResult& aRv)
 {