/ Check-in [d4ab9428]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an obscure memory leak in the SQL compiler.. (CVS 4070)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d4ab94288b1e3d3d069ccc75d0fc2fbe6c1383c5
User & Date: danielk1977 2007-06-15 16:37:29
Context
2007-06-15
17:03
Fix a memory leak in the parser that can occur following a malloc failure. (CVS 4071) check-in: d0b6e9a0 user: drh tags: trunk
16:37
Fix an obscure memory leak in the SQL compiler.. (CVS 4070) check-in: d4ab9428 user: danielk1977 tags: trunk
15:31
Fix a memory leak that was discovered by the tests that were added to cover ticket #2339. (CVS 4069) check-in: 1d10a489 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.297 2007/06/08 00:20:48 drh Exp $
           15  +** $Id: expr.c,v 1.298 2007/06/15 16:37:29 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
  1143   1143             assert( pExpr->pList==0 );
  1144   1144             assert( pExpr->pSelect==0 );
  1145   1145             pDup = sqlite3ExprDup(pEList->a[j].pExpr);
  1146   1146             if( pExpr->flags & EP_ExpCollate ){
  1147   1147               pDup->pColl = pExpr->pColl;
  1148   1148               pDup->flags |= EP_ExpCollate;
  1149   1149             }
         1150  +          if( pExpr->span.dyn ) sqliteFree((char*)pExpr->span.z);
         1151  +          if( pExpr->token.dyn ) sqliteFree((char*)pExpr->token.z);
  1150   1152             memcpy(pExpr, pDup, sizeof(*pExpr));
  1151   1153             sqliteFree(pDup);
  1152   1154             cnt = 1;
  1153   1155             assert( zTab==0 && zDb==0 );
  1154   1156             goto lookupname_end_2;
  1155   1157           }
  1156   1158         }