From 28ec17d596bbbccb5ec7f3d8f6f3eda88f2cd073 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 20 May 2010 20:21:09 -0400 Subject: [PATCH] Bug 567254 - Crash in Connection::getFilename for memory-based databases; r=sdwilsh --HG-- extra : rebase_source : 9fb1300af8c6b35a4e1aa229af032cd08a76e721 --- storage/src/mozStorageConnection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp index c7a7f2c452ff..e7760a60a4d8 100644 --- a/storage/src/mozStorageConnection.cpp +++ b/storage/src/mozStorageConnection.cpp @@ -599,8 +599,10 @@ Connection::internalClose() nsCString Connection::getFilename() { - nsCString leafname; - (void)mDatabaseFile->GetNativeLeafName(leafname); + nsCString leafname(":memory:"); + if (mDatabaseFile) { + (void)mDatabaseFile->GetNativeLeafName(leafname); + } return leafname; }