/ Check-in [f229487c]
Login

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

Overview
Comment:Fix a memory leak in test_journal.c causing tests to fail.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental
Files: files | file ages | folders
SHA1: f229487cccc7514b2663e8e6e04798702c9cfb10
User & Date: dan 2010-08-09 16:12:52
Context
2010-08-09
16:52
Merge latest trunk changes with experimental branch. check-in: aecbd890 user: dan tags: experimental
16:12
Fix a memory leak in test_journal.c causing tests to fail. check-in: f229487c user: dan tags: experimental
14:47
Change to tcl test infrastructure so that --malloctrace=1 works when sizeof(int)!=sizeof(void*). check-in: c3e771b3 user: dan tags: experimental
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

   897    897           p->eState==PAGER_READER          ? "READER" :
   898    898           p->eState==PAGER_WRITER_LOCKED   ? "WRITER_LOCKED" :
   899    899           p->eState==PAGER_WRITER_CACHEMOD ? "WRITER_CACHEMOD" :
   900    900           p->eState==PAGER_WRITER_DBMOD    ? "WRITER_DBMOD" :
   901    901           p->eState==PAGER_WRITER_FINISHED ? "WRITER_FINISHED" :
   902    902           p->eState==PAGER_ERROR           ? "ERROR" : "?error?"
   903    903         , (int)p->errCode
   904         -      , p->eLock==NO_LOCK         ? "OPEN" :
          904  +      , p->eLock==NO_LOCK         ? "NO_LOCK" :
   905    905           p->eLock==RESERVED_LOCK   ? "RESERVED" :
   906    906           p->eLock==EXCLUSIVE_LOCK  ? "EXCLUSIVE" :
   907    907           p->eLock==SHARED_LOCK     ? "SHARED" :
   908    908           p->eLock==UNKNOWN_LOCK    ? "UNKNOWN" : "?error?"
   909    909         , p->exclusiveMode ? "exclusive" : "normal"
   910    910         , p->journalMode==PAGER_JOURNALMODE_MEMORY   ? "memory" :
   911    911           p->journalMode==PAGER_JOURNALMODE_OFF      ? "off" :

Changes to src/test_journal.c.

   357    357   ** the first journal-header is written to the journal file.
   358    358   */
   359    359   static int openTransaction(jt_file *pMain, jt_file *pJournal){
   360    360     unsigned char *aData;
   361    361     sqlite3_file *p = pMain->pReal;
   362    362     int rc = SQLITE_OK;
   363    363   
          364  +  closeTransaction(pMain);
   364    365     aData = sqlite3_malloc(pMain->nPagesize);
   365    366     pMain->pWritable = sqlite3BitvecCreate(pMain->nPage);
   366    367     pMain->aCksum = sqlite3_malloc(sizeof(u32) * (pMain->nPage + 1));
   367    368     pJournal->iMaxOff = 0;
   368    369   
   369    370     if( !pMain->pWritable || !pMain->aCksum || !aData ){
   370    371       rc = SQLITE_IOERR_NOMEM;