aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2007-05-04 12:05:56 +0000
committerdanielk1977 <danielk1977@noemail.net>2007-05-04 12:05:56 +0000
commit92d4d7a92e1a1e465a0d5fd3e9a42e90ddcbda4b (patch)
tree9eff7f2f156406262fc1ef28f90f71313f262af6 /src/tclsqlite.c
parent126afe6b599c3096e7b4bfdf842181b7cef89a21 (diff)
downloadsqlite-92d4d7a92e1a1e465a0d5fd3e9a42e90ddcbda4b.tar.gz
sqlite-92d4d7a92e1a1e465a0d5fd3e9a42e90ddcbda4b.zip
Test cases and corrections to IO and malloc() error handling in incremental blob IO functions. (CVS 3915)
FossilOrigin-Name: 641e55284e1ba6070073c83ac6ed78ffb29f7e60
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 1a2567e8c..79429cb16 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
-** $Id: tclsqlite.c,v 1.182 2007/05/03 16:31:26 danielk1977 Exp $
+** $Id: tclsqlite.c,v 1.183 2007/05/04 12:05:56 danielk1977 Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -153,7 +153,8 @@ static void closeIncrblobChannels(SqliteDb *pDb){
*/
static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
IncrblobChannel *p = (IncrblobChannel *)instanceData;
- sqlite3_blob_close(p->pBlob);
+ int rc = sqlite3_blob_close(p->pBlob);
+ sqlite3 *db = p->pDb->db;
/* Remove the channel from the SqliteDb.pIncrblob list. */
if( p->pNext ){
@@ -166,7 +167,13 @@ static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
p->pDb->pIncrblob = p->pNext;
}
+ /* Free the IncrblobChannel structure */
Tcl_Free((char *)p);
+
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)sqlite3_errmsg(db), TCL_VOLATILE);
+ return TCL_ERROR;
+ }
return TCL_OK;
}