aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c7
-rw-r--r--src/test1.c8
-rw-r--r--src/vdbeapi.c2
3 files changed, 13 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 59e524a3d..77fe0710a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.325 2006/01/18 04:26:07 danielk1977 Exp $
+** $Id: main.c,v 1.326 2006/01/18 05:51:58 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -727,6 +727,7 @@ const void *sqlite3_errmsg16(sqlite3 *db){
SQLITE_UTF8, SQLITE_STATIC);
z = sqlite3_value_text16(db->pErr);
}
+ sqlite3MallocClearFailed();
return z;
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -930,6 +931,10 @@ int sqlite3_open16(
rc = openDatabase(zFilename8, ppDb);
if( rc==SQLITE_OK && *ppDb ){
rc = sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
+ if( rc!=SQLITE_OK ){
+ sqlite3_close(*ppDb);
+ *ppDb = 0;
+ }
}
}else{
assert( sqlite3ThreadDataReadOnly()->mallocFailed );
diff --git a/src/test1.c b/src/test1.c
index d211ee39e..ba2467f5e 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.194 2006/01/18 04:26:07 danielk1977 Exp $
+** $Id: test1.c,v 1.195 2006/01/18 05:51:58 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -2049,7 +2049,7 @@ static int test_errmsg16(
#ifndef SQLITE_OMIT_UTF16
sqlite3 *db;
const void *zErr;
- int bytes;
+ int bytes = 0;
if( objc!=2 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -2059,7 +2059,9 @@ static int test_errmsg16(
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
zErr = sqlite3_errmsg16(db);
- bytes = sqlite3utf16ByteLen(zErr, -1);
+ if( zErr ){
+ bytes = sqlite3utf16ByteLen(zErr, -1);
+ }
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(zErr, bytes));
#endif /* SQLITE_OMIT_UTF16 */
return TCL_OK;
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 2c3f9ae20..5d5ec27f2 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -780,7 +780,9 @@ int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
return SQLITE_ERROR;
}
for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
+ sqlite3MallocDisallow();
rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
+ sqlite3MallocAllow();
}
return rc;
}