/ Check-in [37e60d21]
Login

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

Overview
Comment:Fix a memory leak of the temporary read buffer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winPreCache
Files: files | file ages | folders
SHA1:37e60d211f70d12eda6d8b63da5e5e307e9d1748
User & Date: mistachkin 2014-05-08 22:08:22
Context
2014-05-08
22:15
Fix typos in logging code. check-in: dc7f84df user: mistachkin tags: winPreCache
22:08
Fix a memory leak of the temporary read buffer. check-in: 37e60d21 user: mistachkin tags: winPreCache
22:05
Update comments and only include the thread routine when required. check-in: a60c545f user: mistachkin tags: winPreCache
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

3260
3261
3262
3263
3264
3265
3266

3267
3268
3269
3270
3271
3272

3273
3274
3275
3276
3277
3278
3279
3280
3281
3282

3283
3284
3285
3286
3287
3288
3289
    osCloseHandle(dupHandle);
    OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_NOMEM\n", dupHandle));
    return SQLITE_IOERR_NOMEM;
  }
  while( 1 ){
    if( !osReadFile(dupHandle, pBuf, dwAmt, &nRead, 0) ){
      pFile->lastErrno = osGetLastError();

      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
                         "winPreCacheThread3", pFile->zPath);
    }
    if( nRead<dwAmt ){

      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SHORT_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_SHORT_READ, pFile->lastErrno,
                         "winPreCacheThread4", pFile->zPath);
    }
    dwSize -= dwAmt;
    if( dwSize==0 ){
      break;
    }
  }

  osCloseHandle(dupHandle);
  return SQLITE_OK;
}
#endif

/* 
** Windows will only let you create file view mappings







>






>










>







3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
    osCloseHandle(dupHandle);
    OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_NOMEM\n", dupHandle));
    return SQLITE_IOERR_NOMEM;
  }
  while( 1 ){
    if( !osReadFile(dupHandle, pBuf, dwAmt, &nRead, 0) ){
      pFile->lastErrno = osGetLastError();
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
                         "winPreCacheThread3", pFile->zPath);
    }
    if( nRead<dwAmt ){
      sqlite3_free(pBuf);
      osCloseHandle(dupHandle);
      OSTRACE(("PRE-CACHE file=%p, rc=SQLITE_IOERR_SHORT_READ\n", dupHandle));
      return winLogError(SQLITE_IOERR_SHORT_READ, pFile->lastErrno,
                         "winPreCacheThread4", pFile->zPath);
    }
    dwSize -= dwAmt;
    if( dwSize==0 ){
      break;
    }
  }
  sqlite3_free(pBuf);
  osCloseHandle(dupHandle);
  return SQLITE_OK;
}
#endif

/* 
** Windows will only let you create file view mappings