1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Handle transient malloc() failures in sqlite3CreateFunc(). (CVS 4371)

FossilOrigin-Name: c0ce63196458c81e0859fc8a38f2dd2145a580bc
This commit is contained in:
danielk1977
2007-09-03 11:04:22 +00:00
parent 369ff42e77
commit fa18bece7a
8 changed files with 75 additions and 38 deletions

View File

@ -16,7 +16,7 @@
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.45 2007/08/29 12:31:29 danielk1977 Exp $
# $Id: malloc.test,v 1.46 2007/09/03 11:04:22 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -259,6 +259,9 @@ do_malloc_test 10 -sqlprep {
# sqlite3_create_function().
do_malloc_test 11 -tclbody {
set rc [sqlite3_create_function db]
if {[string match $rc SQLITE_OK]} {
set rc [sqlite3_create_aggregate db]
}
if {[string match $rc SQLITE_NOMEM]} {
error "out of memory"
}