1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Fix a segfault that can occur if a malloc fails in ATTACH in shared-cache mode.

FossilOrigin-Name: 875f8fa32708b8dbf314fd7056fac2fefdacfa36
This commit is contained in:
dan
2010-02-23 10:56:15 +00:00
parent ca07b9df47
commit 440ac39bc0
4 changed files with 27 additions and 10 deletions

View File

@@ -60,4 +60,17 @@ do_malloc_test attachmalloc-2 -tclprep {
ATTACH 'test2.db' AS db1;
}
set enable_shared_cache [sqlite3_enable_shared_cache 1]
sqlite3 dbaux test2.db
dbaux eval {SELECT * FROM sqlite_master}
do_malloc_test attachmalloc-3 -sqlbody {
SELECT * FROM sqlite_master;
ATTACH 'test2.db' AS two;
} -cleanup {
db eval { DETACH two }
}
dbaux close
sqlite3_enable_shared_cache $enable_shared_cache
finish_test