mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Fix another segfault that can occur following a malloc failure in the SQL compiler. (CVS 4748)
FossilOrigin-Name: 9d98a3f0dded4ee7ed53872f48ee8592ff077f92
This commit is contained in:
10
src/select.c
10
src/select.c
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle SELECT statements in SQLite.
|
||||
**
|
||||
** $Id: select.c,v 1.408 2008/01/23 15:44:51 danielk1977 Exp $
|
||||
** $Id: select.c,v 1.409 2008/01/23 17:13:41 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -1676,15 +1676,15 @@ static int processCompoundOrderBy(
|
||||
while( pSelect && moreToDo ){
|
||||
moreToDo = 0;
|
||||
for(i=0; i<pOrderBy->nExpr; i++){
|
||||
int iCol;
|
||||
int iCol = -1;
|
||||
Expr *pE, *pDup;
|
||||
if( pOrderBy->a[i].done ) continue;
|
||||
pE = pOrderBy->a[i].pExpr;
|
||||
pDup = sqlite3ExprDup(db, pE);
|
||||
if( pDup==0 ){
|
||||
return 1;
|
||||
if( !db->mallocFailed ){
|
||||
assert(pDup);
|
||||
iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
|
||||
}
|
||||
iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
|
||||
sqlite3ExprDelete(pDup);
|
||||
if( iCol<0 ){
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user