Index: System.Data.SQLite/SQLite3.cs ================================================================== --- System.Data.SQLite/SQLite3.cs +++ System.Data.SQLite/SQLite3.cs @@ -2862,11 +2862,11 @@ CultureInfo.CurrentCulture, "configuration value type mismatch, must be of type {0}", typeof(string))); } - SQLiteErrorCode rc = SQLiteErrorCode.Ok; + SQLiteErrorCode rc = SQLiteErrorCode.Error; IntPtr pDbName = IntPtr.Zero; try { pDbName = SQLiteString.Utf8IntPtrFromString( @@ -2883,11 +2883,13 @@ _sql, option, pDbName); if (rc == SQLiteErrorCode.Ok) { FreeDbName(true); + dbName = pDbName; + pDbName = IntPtr.Zero; } } finally { if ((rc != SQLiteErrorCode.Ok) &&