for(i=0; pItem && i<p->nExpr; i++, pItem++){
if( pItem==0 ){ sqliteFree(pNew); return 0; } for(i=0; i<p->nExpr; i++, pItem++){
ExprList *sqliteExprListDup(ExprList *p){  ExprList *pNew;  struct ExprList_item *pItem;  int i;  if( p==0 ) return 0;  pNew = sqliteMalloc( sizeof(*pNew) );  if( pNew==0 ) return 0;  pNew->nExpr = pNew->nAlloc = p->nExpr;  pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) );  for(i=0; pItem && i<p->nExpr; i++, pItem++){    Expr *pNewExpr, *pOldExpr;    pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr);    if( pOldExpr->span.z!=0 && pNewExpr ){      /* Always make a copy of the span for top-level expressions in the      ** expression list.  The logic in SELECT processing that determines      ** the names of columns in the result set needs this information */      sqliteTokenCopy(&pNewExpr->span, &pOldExpr->span);    }    assert( pNewExpr==0 || pNewExpr->span.z!=0             || pOldExpr->span.z==0 || sqlite_malloc_failed );    pItem->zName = sqliteStrDup(p->a[i].zName);    pItem->sortOrder = p->a[i].sortOrder;    pItem->isAgg = p->a[i].isAgg;    pItem->done = 0;  }  return pNew;}