diff options
author | drh <drh@noemail.net> | 2006-03-06 20:55:46 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2006-03-06 20:55:46 +0000 |
commit | 43617e9ab974aafae00be170ec52851206830b3d (patch) | |
tree | dfabb1d0c065c1fad8a0193d450d3ab5d93a9dfb /src/expr.c | |
parent | c001c58a7257475870973d2bc4c679b75fcdac39 (diff) | |
download | sqlite-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/expr.c')
-rw-r--r-- | src/expr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index 0edad9974..857294739 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.255 2006/03/02 04:44:24 drh Exp $ +** $Id: expr.c,v 1.256 2006/03/06 20:55:46 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -841,11 +841,13 @@ static int lookupName( if( pSrcList ){ for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){ - Table *pTab = pItem->pTab; - int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); + Table *pTab; + int iDb; Column *pCol; - if( pTab==0 ) continue; + pTab = pItem->pTab; + assert( pTab!=0 ); + iDb = sqlite3SchemaToIndex(db, pTab->pSchema); assert( pTab->nCol>0 ); if( zTab ){ if( pItem->zAlias ){ |