/ Check-in [407a85e6]
Login

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

Overview
Comment:Fix a memory leak that occurs after a malloc failure in trigger parsing. (CVS 3772)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 407a85e69b7a1229218a5ce9a9e31255c7070294
User & Date: drh 2007-03-30 20:40:34
Context
2007-03-30
20:43
Remove vestiges of the SQLITE_PROTOCOL error. (CVS 3773) check-in: 6dfd4a12 user: drh tags: trunk
20:40
Fix a memory leak that occurs after a malloc failure in trigger parsing. (CVS 3772) check-in: 407a85e6 user: drh tags: trunk
18:42
Fix a memory leak in multi-database commit. Also enhance a comment that explains why a particular valgrind error is harmless. (CVS 3771) check-in: 28c7ed1e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/trigger.c.

   386    386   TriggerStep *sqlite3TriggerUpdateStep(
   387    387     Token *pTableName,   /* Name of the table to be updated */
   388    388     ExprList *pEList,    /* The SET clause: list of column and new values */
   389    389     Expr *pWhere,        /* The WHERE clause */
   390    390     int orconf           /* The conflict algorithm. (OE_Abort, OE_Ignore, etc) */
   391    391   ){
   392    392     TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
   393         -  if( pTriggerStep==0 ) return 0;
          393  +  if( pTriggerStep==0 ){
          394  +     sqlite3ExprListDelete(pEList);
          395  +     sqlite3ExprDelete(pWhere);
          396  +     return 0;
          397  +  }
   394    398   
   395    399     pTriggerStep->op = TK_UPDATE;
   396    400     pTriggerStep->target  = *pTableName;
   397    401     pTriggerStep->pExprList = pEList;
   398    402     pTriggerStep->pWhere = pWhere;
   399    403     pTriggerStep->orconf = orconf;
   400    404     sqlitePersistTriggerStep(pTriggerStep);