1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Fix segfaults that might occur after a malloc failure. (CVS 2119)

FossilOrigin-Name: 368774487e7a0266465f5a1c2701c9b14573d26c
This commit is contained in:
drh
2004-11-20 18:13:10 +00:00
parent f9c852bfd5
commit 73c42a1386
4 changed files with 31 additions and 20 deletions

View File

@@ -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.170 2004/11/12 03:56:15 drh Exp $
** $Id: expr.c,v 1.171 2004/11/20 18:13:10 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -220,6 +220,9 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
return 0;
}
p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);
if( p==0 ){
return 0; /* Malloc failed */
}
depth = atoi(&pToken->z[1]);
if( depth>=0 ){
p->iTable = pParse->nMem++;