/ Check-in [28c7ed1e]
Login

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

Overview
Comment:Fix a memory leak in multi-database commit. Also enhance a comment that explains why a particular valgrind error is harmless. (CVS 3771)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 28c7ed1eb799203a569cdae97da974b347f39579
User & Date: drh 2007-03-30 18:42:56
Context
2007-03-30
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
18:21
Coverage testing for a few lines in pager.c. (CVS 3770) check-in: c1aca18f user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.597 2007/03/30 11:23:45 drh Exp $
           46  +** $Id: vdbe.c,v 1.598 2007/03/30 18:42:56 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include "vdbeInt.h"
    52     52   
    53     53   /*
................................................................................
  3101   3101       rc = sqlite3BtreeMoveto(pCrsr, 0, iKey, 0,&res);
  3102   3102       pC->lastRowid = pTos->u.i;
  3103   3103       pC->rowidIsValid = res==0;
  3104   3104       pC->nullRow = 0;
  3105   3105       pC->cacheStatus = CACHE_STALE;
  3106   3106       /* res might be uninitialized if rc!=SQLITE_OK.  But if rc!=SQLITE_OK
  3107   3107       ** processing is about to abort so we really do not care whether or not
  3108         -    ** the following jump is taken. */
         3108  +    ** the following jump is taken.  (In other words, do not stress over
         3109  +    ** the error that valgrind sometimes shows on the next statement when
         3110  +    ** running ioerr.test and similar failure-recovery test scripts.) */
  3109   3111       if( res!=0 ){
  3110   3112         pc = pOp->p2 - 1;
  3111   3113         pC->rowidIsValid = 0;
  3112   3114       }
  3113   3115     }
  3114   3116     Release(pTos);
  3115   3117     pTos--;

Changes to src/vdbeaux.c.

  1201   1201       }
  1202   1202   
  1203   1203       /* Delete the master journal file. This commits the transaction. After
  1204   1204       ** doing this the directory is synced again before any individual
  1205   1205       ** transaction files are deleted.
  1206   1206       */
  1207   1207       rc = sqlite3OsDelete(zMaster);
         1208  +    sqliteFree(zMaster);
         1209  +    zMaster = 0;
  1208   1210       if( rc ){
  1209   1211         return rc;
  1210   1212       }
  1211         -    sqliteFree(zMaster);
  1212         -    zMaster = 0;
  1213   1213       rc = sqlite3OsSyncDirectory(zMainFile);
  1214   1214       if( rc!=SQLITE_OK ){
  1215   1215         /* This is not good. The master journal file has been deleted, but
  1216   1216         ** the directory sync failed. There is no completely safe course of
  1217   1217         ** action from here. The individual journals contain the name of the
  1218   1218         ** master journal file, but there is no way of knowing if that
  1219   1219         ** master journal exists now or if it will exist after the operating