Bug 643674 - firefox 4 crash [@ nsCookieService::HandleCorruptDB(DBState*) ] and t [@ nsCookieService::HandleCorruptDB ]; r=sdwilsh
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 28 Mar 2011 16:24:05 -0400
changeset 64102 da46b5e30792e29be6b04858e151303607368ffa
parent 64101 d49c938dbded5b105da0db629eba3572b16ab99c
child 64103 678e2a2d2195ef0bc57b3ba9f5253e1d1b09f5a9
push idunknown
push userunknown
push dateunknown
reviewerssdwilsh
bugs643674
milestone2.2a1pre
Bug 643674 - firefox 4 crash [@ nsCookieService::HandleCorruptDB(DBState*) ] and t [@ nsCookieService::HandleCorruptDB ]; r=sdwilsh
netwerk/cookie/nsCookieService.cpp
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -1252,17 +1252,19 @@ nsCookieService::HandleCorruptDB(DBState
   case DBState::CLOSING_FOR_REBUILD: {
     // We had an error while waiting for close completion. That's OK, just
     // ignore it -- we're rebuilding anyway.
     return;
   }
   case DBState::REBUILDING: {
     // We had an error while rebuilding the DB. Game over. Close the database
     // and let the close handler do nothing; then we'll move it out of the way.
-    mDefaultDBState->dbConn->AsyncClose(mDefaultDBState->closeListener);
+    if (mDefaultDBState->dbConn) {
+      mDefaultDBState->dbConn->AsyncClose(mDefaultDBState->closeListener);
+    }
     CloseDefaultDBConnection();
     break;
   }
   }
 }
 
 static PLDHashOperator
 RebuildDBCallback(nsCookieEntry *aEntry,