1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

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

FossilOrigin-Name: e37137376a2b23062e2625b5285299b33630b326
This commit is contained in:
dan
2010-02-23 11:05:26 +00:00
parent 9978c97ec5
commit 39547b418b
4 changed files with 27 additions and 20 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