aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2006-03-06 20:55:46 +0000
committerdrh <drh@noemail.net>2006-03-06 20:55:46 +0000
commit43617e9ab974aafae00be170ec52851206830b3d (patch)
treedfabb1d0c065c1fad8a0193d450d3ab5d93a9dfb /src/tclsqlite.c
parentc001c58a7257475870973d2bc4c679b75fcdac39 (diff)
downloadsqlite-43617e9ab974aafae00be170ec52851206830b3d.tar.gz
sqlite-43617e9ab974aafae00be170ec52851206830b3d.zip
Code changes resulting from Coverity analysis.
http://scan.coverity.com/ Found 1 potential segfault in sqlite3_mprintf(). Also 2 failures to fclose() following a malloc() failure. And lots of cases where unnecessary conditionals could be removed from the code. (CVS 3126) FossilOrigin-Name: e510e6dd9d6261f33b853af3b32d155b9d6b63b3
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index ed6123be1..8f3a0b68a 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.152 2006/03/03 20:32:19 drh Exp $
+** $Id: tclsqlite.c,v 1.153 2006/03/06 20:55:46 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -1085,6 +1085,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
azCol = malloc( sizeof(azCol[0])*(nCol+1) );
if( azCol==0 ) {
Tcl_AppendResult(interp, "Error: can't malloc()", 0);
+ fclose(in);
return TCL_ERROR;
}
sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0);