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

Assorted memory leak fixes. (CVS 1600)

FossilOrigin-Name: 07b90f3690768e852384fbbde0ba59e69e24d1da
This commit is contained in:
danielk1977
2004-06-15 16:51:01 +00:00
parent b20e56b451
commit e00484002f
8 changed files with 68 additions and 42 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.141 2004/06/12 09:25:14 danielk1977 Exp $
** $Id: expr.c,v 1.142 2004/06/15 16:51:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -307,7 +307,10 @@ ExprList *sqlite3ExprListDup(ExprList *p){
if( pNew==0 ) return 0;
pNew->nExpr = pNew->nAlloc = p->nExpr;
pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) );
if( pItem==0 ) return 0; /* Leaks memory after a malloc failure */
if( pItem==0 ){
sqliteFree(pNew);
return 0;
}
for(i=0; i<p->nExpr; i++, pItem++){
Expr *pNewExpr, *pOldExpr;
pItem->pExpr = pNewExpr = sqlite3ExprDup(pOldExpr = p->a[i].pExpr);