Bug 567254 - Crash in Connection::getFilename for memory-based databases; r=sdwilsh
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 20 May 2010 20:21:09 -0400
changeset 42898 5d48e78f6ffaf9d3335e7e60ed8fd18bb791fed2
parent 42897 7153afde1b42313227f6c449bb5b30b768bb6c39
child 42899 3523f41cd62c8da5acecbbd02d334f235c3aa4a4
push idunknown
push userunknown
push dateunknown
reviewerssdwilsh
bugs567254
milestone1.9.3a5pre
Bug 567254 - Crash in Connection::getFilename for memory-based databases; r=sdwilsh
storage/src/mozStorageConnection.cpp
--- a/storage/src/mozStorageConnection.cpp
+++ b/storage/src/mozStorageConnection.cpp
@@ -594,18 +594,20 @@ Connection::internalClose()
 
   mDBConn = NULL;
   return convertResultCode(srv);
 }
 
 nsCString
 Connection::getFilename()
 {
-  nsCString leafname;
-  (void)mDatabaseFile->GetNativeLeafName(leafname);
+  nsCString leafname(":memory:");
+  if (mDatabaseFile) {
+    (void)mDatabaseFile->GetNativeLeafName(leafname);
+  }
   return leafname;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// mozIStorageConnection
 
 NS_IMETHODIMP
 Connection::Close()