SQLite

Check-in [c3dc15e717]
Login

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

Overview
Comment:Fix a memory leak in sqlite3ota.c that can follow an OOM error.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: c3dc15e71782fc70e92b71ad9eec0cf8ffef611f
User & Date: dan 2015-04-17 16:29:11.767
Context
2015-04-17
17:00
Ensure that filenames passed to the VFS xOpen() function are terminated by 2 '\0' bytes. (check-in: 66eff473c3 user: dan tags: ota-update)
16:29
Fix a memory leak in sqlite3ota.c that can follow an OOM error. (check-in: c3dc15e717 user: dan tags: ota-update)
08:36
Have OTA always specify SQLITE_CONFIG_URI when opening databases. Fix a test issue causing otacrash.test to fail. (check-in: 0d0e5ec064 user: dan tags: ota-update)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/ota/sqlite3ota.c.
3330
3331
3332
3333
3334
3335
3336


3337
3338
3339
3340
3341
3342
3343
    pFile->pMethods = &otavfs_io_methods;
    if( flags & SQLITE_OPEN_MAIN_DB ){
      sqlite3_mutex_enter(pOtaVfs->mutex);
      pFd->pMainNext = pOtaVfs->pMain;
      pOtaVfs->pMain = pFd;
      sqlite3_mutex_leave(pOtaVfs->mutex);
    }


  }

  return rc;
}

/*
** Delete the file located at zPath.







>
>







3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
    pFile->pMethods = &otavfs_io_methods;
    if( flags & SQLITE_OPEN_MAIN_DB ){
      sqlite3_mutex_enter(pOtaVfs->mutex);
      pFd->pMainNext = pOtaVfs->pMain;
      pOtaVfs->pMain = pFd;
      sqlite3_mutex_leave(pOtaVfs->mutex);
    }
  }else{
    sqlite3_free(pFd->zDel);
  }

  return rc;
}

/*
** Delete the file located at zPath.