| | @@ -449,12 +449,12 @@ |
| 449 | 449 | wchar_t *b1, *b2; |
| 450 | 450 | int sz1, sz2; |
| 451 | 451 | |
| 452 | 452 | sz1 = (int)strlen(zFilename); |
| 453 | 453 | sz2 = (int)strlen(zMode); |
| 454 | | - b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) ); |
| 455 | | - b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) ); |
| 454 | + b1 = sqlite3_malloc64( (sz1+1)*sizeof(b1[0]) ); |
| 455 | + b2 = sqlite3_malloc64( (sz2+1)*sizeof(b1[0]) ); |
| 456 | 456 | if( b1 && b2 ){ |
| 457 | 457 | sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1); |
| 458 | 458 | b1[sz1] = 0; |
| 459 | 459 | sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2); |
| 460 | 460 | b2[sz2] = 0; |
| | @@ -475,12 +475,12 @@ |
| 475 | 475 | wchar_t *b1, *b2; |
| 476 | 476 | int sz1, sz2; |
| 477 | 477 | |
| 478 | 478 | sz1 = (int)strlen(zCommand); |
| 479 | 479 | sz2 = (int)strlen(zMode); |
| 480 | | - b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) ); |
| 481 | | - b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) ); |
| 480 | + b1 = sqlite3_malloc64( (sz1+1)*sizeof(b1[0]) ); |
| 481 | + b2 = sqlite3_malloc64( (sz2+1)*sizeof(b1[0]) ); |
| 482 | 482 | if( b1 && b2 ){ |
| 483 | 483 | sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1); |
| 484 | 484 | b1[sz1] = 0; |
| 485 | 485 | sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2); |
| 486 | 486 | b2[sz2] = 0; |
| | @@ -499,11 +499,11 @@ |
| 499 | 499 | /* When reading from the command-prompt in Windows, it is necessary |
| 500 | 500 | ** to use _O_WTEXT input mode to read UTF-16 characters, then translate |
| 501 | 501 | ** that into UTF-8. Otherwise, non-ASCII characters all get translated |
| 502 | 502 | ** into '?'. |
| 503 | 503 | */ |
| 504 | | - wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) ); |
| 504 | + wchar_t *b1 = sqlite3_malloc64( sz*sizeof(wchar_t) ); |
| 505 | 505 | if( b1==0 ) return 0; |
| 506 | 506 | #ifdef SQLITE_USE_W32_FOR_CONSOLE_IO |
| 507 | 507 | DWORD nRead = 0; |
| 508 | 508 | if( IsConsole(in) |
| 509 | 509 | && ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz-1, &nRead, 0) |
| | @@ -574,11 +574,11 @@ |
| 574 | 574 | }else{ |
| 575 | 575 | /* One must use UTF16 in order to get unicode support when writing |
| 576 | 576 | ** to the console on Windows. |
| 577 | 577 | */ |
| 578 | 578 | int sz = (int)strlen(z); |
| 579 | | - wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) ); |
| 579 | + wchar_t *b1 = sqlite3_malloc64( (sz+1)*sizeof(wchar_t) ); |
| 580 | 580 | if( b1==0 ) return 0; |
| 581 | 581 | sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz); |
| 582 | 582 | b1[sz] = 0; |
| 583 | 583 | |
| 584 | 584 | #ifdef SQLITE_USE_W32_FOR_CONSOLE_IO |
| | @@ -683,11 +683,11 @@ |
| 683 | 683 | ** May you find forgiveness for yourself and forgive others. |
| 684 | 684 | ** May you share freely, never taking more than you give. |
| 685 | 685 | ** |
| 686 | 686 | ************************************************************************* |
| 687 | 687 | ** Header file for the Result-Format or "resfmt" utility library for SQLite. |
| 688 | | -** See the resfmt.md documentation for additional information. |
| 688 | +** See the README.md documentation for additional information. |
| 689 | 689 | */ |
| 690 | 690 | #ifndef SQLITE_QRF_H |
| 691 | 691 | #define SQLITE_QRF_H |
| 692 | 692 | #ifdef __cplusplus |
| 693 | 693 | extern "C" { |
| | @@ -5813,11 +5813,11 @@ |
| 5813 | 5813 | Decimal *p = 0; |
| 5814 | 5814 | int i; |
| 5815 | 5815 | int iExp = 0; |
| 5816 | 5816 | |
| 5817 | 5817 | if( zIn==0 ) goto new_from_text_failed; |
| 5818 | | - p = sqlite3_malloc( sizeof(*p) ); |
| 5818 | + p = sqlite3_malloc64( sizeof(*p) ); |
| 5819 | 5819 | if( p==0 ) goto new_from_text_failed; |
| 5820 | 5820 | p->sign = 0; |
| 5821 | 5821 | p->oom = 0; |
| 5822 | 5822 | p->isInit = 1; |
| 5823 | 5823 | p->isNull = 0; |
| | @@ -6553,11 +6553,11 @@ |
| 6553 | 6553 | UNUSED_PARAMETER(argc); |
| 6554 | 6554 | p = sqlite3_aggregate_context(context, sizeof(*p)); |
| 6555 | 6555 | if( p==0 ) return; |
| 6556 | 6556 | if( !p->isInit ){ |
| 6557 | 6557 | p->isInit = 1; |
| 6558 | | - p->a = sqlite3_malloc(2); |
| 6558 | + p->a = sqlite3_malloc64(2); |
| 6559 | 6559 | if( p->a==0 ){ |
| 6560 | 6560 | p->oom = 1; |
| 6561 | 6561 | }else{ |
| 6562 | 6562 | p->a[0] = 0; |
| 6563 | 6563 | } |
| | @@ -6926,11 +6926,11 @@ |
| 6926 | 6926 | goto memFail; |
| 6927 | 6927 | } |
| 6928 | 6928 | sqlite3_result_text(context,"",-1,SQLITE_STATIC); |
| 6929 | 6929 | break; |
| 6930 | 6930 | } |
| 6931 | | - cBuf = sqlite3_malloc(nc); |
| 6931 | + cBuf = sqlite3_malloc64(nc); |
| 6932 | 6932 | if( !cBuf ) goto memFail; |
| 6933 | 6933 | nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); |
| 6934 | 6934 | sqlite3_result_text(context, cBuf, nc, sqlite3_free); |
| 6935 | 6935 | break; |
| 6936 | 6936 | case SQLITE_TEXT: |
| | @@ -6948,11 +6948,11 @@ |
| 6948 | 6948 | goto memFail; |
| 6949 | 6949 | } |
| 6950 | 6950 | sqlite3_result_zeroblob(context, 0); |
| 6951 | 6951 | break; |
| 6952 | 6952 | } |
| 6953 | | - bBuf = sqlite3_malloc(nb); |
| 6953 | + bBuf = sqlite3_malloc64(nb); |
| 6954 | 6954 | if( !bBuf ) goto memFail; |
| 6955 | 6955 | nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); |
| 6956 | 6956 | sqlite3_result_blob(context, bBuf, nb, sqlite3_free); |
| 6957 | 6957 | break; |
| 6958 | 6958 | default: |
| | @@ -7303,11 +7303,11 @@ |
| 7303 | 7303 | goto memFail; |
| 7304 | 7304 | } |
| 7305 | 7305 | sqlite3_result_text(context,"",-1,SQLITE_STATIC); |
| 7306 | 7306 | break; |
| 7307 | 7307 | } |
| 7308 | | - cBuf = sqlite3_malloc(nc); |
| 7308 | + cBuf = sqlite3_malloc64(nc); |
| 7309 | 7309 | if( !cBuf ) goto memFail; |
| 7310 | 7310 | nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); |
| 7311 | 7311 | sqlite3_result_text(context, cBuf, nc, sqlite3_free); |
| 7312 | 7312 | break; |
| 7313 | 7313 | case SQLITE_TEXT: |
| | @@ -7325,11 +7325,11 @@ |
| 7325 | 7325 | goto memFail; |
| 7326 | 7326 | } |
| 7327 | 7327 | sqlite3_result_zeroblob(context, 0); |
| 7328 | 7328 | break; |
| 7329 | 7329 | } |
| 7330 | | - bBuf = sqlite3_malloc(nb); |
| 7330 | + bBuf = sqlite3_malloc64(nb); |
| 7331 | 7331 | if( !bBuf ) goto memFail; |
| 7332 | 7332 | nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); |
| 7333 | 7333 | sqlite3_result_blob(context, bBuf, nb, sqlite3_free); |
| 7334 | 7334 | break; |
| 7335 | 7335 | default: |
| | @@ -8054,11 +8054,11 @@ |
| 8054 | 8054 | (void)argvUnused; |
| 8055 | 8055 | (void)pzErrUnused; |
| 8056 | 8056 | rc = sqlite3_declare_vtab(db, |
| 8057 | 8057 | "CREATE TABLE x(value,start hidden,stop hidden,step hidden)"); |
| 8058 | 8058 | if( rc==SQLITE_OK ){ |
| 8059 | | - pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); |
| 8059 | + pNew = *ppVtab = sqlite3_malloc64( sizeof(*pNew) ); |
| 8060 | 8060 | if( pNew==0 ) return SQLITE_NOMEM; |
| 8061 | 8061 | memset(pNew, 0, sizeof(*pNew)); |
| 8062 | 8062 | sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); |
| 8063 | 8063 | } |
| 8064 | 8064 | return rc; |
| | @@ -8076,11 +8076,11 @@ |
| 8076 | 8076 | ** Constructor for a new series_cursor object. |
| 8077 | 8077 | */ |
| 8078 | 8078 | static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){ |
| 8079 | 8079 | series_cursor *pCur; |
| 8080 | 8080 | (void)pUnused; |
| 8081 | | - pCur = sqlite3_malloc( sizeof(*pCur) ); |
| 8081 | + pCur = sqlite3_malloc64( sizeof(*pCur) ); |
| 8082 | 8082 | if( pCur==0 ) return SQLITE_NOMEM; |
| 8083 | 8083 | memset(pCur, 0, sizeof(*pCur)); |
| 8084 | 8084 | *ppCursor = &pCur->base; |
| 8085 | 8085 | return SQLITE_OK; |
| 8086 | 8086 | } |
| | @@ -9431,11 +9431,11 @@ |
| 9431 | 9431 | ReCompiled *pRe; |
| 9432 | 9432 | const char *zErr; |
| 9433 | 9433 | int i, j; |
| 9434 | 9434 | |
| 9435 | 9435 | *ppRe = 0; |
| 9436 | | - pRe = sqlite3_malloc( sizeof(*pRe) ); |
| 9436 | + pRe = sqlite3_malloc64( sizeof(*pRe) ); |
| 9437 | 9437 | if( pRe==0 ){ |
| 9438 | 9438 | return "out of memory"; |
| 9439 | 9439 | } |
| 9440 | 9440 | memset(pRe, 0, sizeof(*pRe)); |
| 9441 | 9441 | pRe->xNextChar = noCase ? re_next_char_nocase : re_next_char; |
| | @@ -10300,11 +10300,11 @@ |
| 10300 | 10300 | (void)argc; |
| 10301 | 10301 | (void)argv; |
| 10302 | 10302 | (void)pzErr; |
| 10303 | 10303 | rc = sqlite3_declare_vtab(db, "CREATE TABLE x" FSDIR_SCHEMA); |
| 10304 | 10304 | if( rc==SQLITE_OK ){ |
| 10305 | | - pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); |
| 10305 | + pNew = (fsdir_tab*)sqlite3_malloc64( sizeof(*pNew) ); |
| 10306 | 10306 | if( pNew==0 ) return SQLITE_NOMEM; |
| 10307 | 10307 | memset(pNew, 0, sizeof(*pNew)); |
| 10308 | 10308 | sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); |
| 10309 | 10309 | } |
| 10310 | 10310 | *ppVtab = (sqlite3_vtab*)pNew; |
| | @@ -10323,11 +10323,11 @@ |
| 10323 | 10323 | ** Constructor for a new fsdir_cursor object. |
| 10324 | 10324 | */ |
| 10325 | 10325 | static int fsdirOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){ |
| 10326 | 10326 | fsdir_cursor *pCur; |
| 10327 | 10327 | (void)p; |
| 10328 | | - pCur = sqlite3_malloc( sizeof(*pCur) ); |
| 10328 | + pCur = sqlite3_malloc64( sizeof(*pCur) ); |
| 10329 | 10329 | if( pCur==0 ) return SQLITE_NOMEM; |
| 10330 | 10330 | memset(pCur, 0, sizeof(*pCur)); |
| 10331 | 10331 | pCur->iLvl = -1; |
| 10332 | 10332 | *ppCursor = &pCur->base; |
| 10333 | 10333 | return SQLITE_OK; |
| | @@ -11056,11 +11056,11 @@ |
| 11056 | 11056 | " prefix TEXT HIDDEN," |
| 11057 | 11057 | " wholeline TEXT HIDDEN," |
| 11058 | 11058 | " phase INT HIDDEN" /* Used for debugging only */ |
| 11059 | 11059 | ")"); |
| 11060 | 11060 | if( rc==SQLITE_OK ){ |
| 11061 | | - pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 11061 | + pNew = sqlite3_malloc64( sizeof(*pNew) ); |
| 11062 | 11062 | *ppVtab = (sqlite3_vtab*)pNew; |
| 11063 | 11063 | if( pNew==0 ) return SQLITE_NOMEM; |
| 11064 | 11064 | memset(pNew, 0, sizeof(*pNew)); |
| 11065 | 11065 | pNew->db = db; |
| 11066 | 11066 | } |
| | @@ -11078,11 +11078,11 @@ |
| 11078 | 11078 | /* |
| 11079 | 11079 | ** Constructor for a new completion_cursor object. |
| 11080 | 11080 | */ |
| 11081 | 11081 | static int completionOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){ |
| 11082 | 11082 | completion_cursor *pCur; |
| 11083 | | - pCur = sqlite3_malloc( sizeof(*pCur) ); |
| 11083 | + pCur = sqlite3_malloc64( sizeof(*pCur) ); |
| 11084 | 11084 | if( pCur==0 ) return SQLITE_NOMEM; |
| 11085 | 11085 | memset(pCur, 0, sizeof(*pCur)); |
| 11086 | 11086 | pCur->db = ((completion_vtab*)p)->db; |
| 11087 | 11087 | *ppCursor = &pCur->base; |
| 11088 | 11088 | return SQLITE_OK; |
| | @@ -12582,11 +12582,11 @@ |
| 12582 | 12582 | ** Constructor for a new ZipfileCsr object. |
| 12583 | 12583 | */ |
| 12584 | 12584 | static int zipfileOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCsr){ |
| 12585 | 12585 | ZipfileTab *pTab = (ZipfileTab*)p; |
| 12586 | 12586 | ZipfileCsr *pCsr; |
| 12587 | | - pCsr = sqlite3_malloc(sizeof(*pCsr)); |
| 12587 | + pCsr = sqlite3_malloc64(sizeof(*pCsr)); |
| 12588 | 12588 | *ppCsr = (sqlite3_vtab_cursor*)pCsr; |
| 12589 | 12589 | if( pCsr==0 ){ |
| 12590 | 12590 | return SQLITE_NOMEM; |
| 12591 | 12591 | } |
| 12592 | 12592 | memset(pCsr, 0, sizeof(*pCsr)); |
| | @@ -13121,11 +13121,11 @@ |
| 13121 | 13121 | sqlite3_context *pCtx, /* Store result here */ |
| 13122 | 13122 | const u8 *aIn, /* Compressed data */ |
| 13123 | 13123 | int nIn, /* Size of buffer aIn[] in bytes */ |
| 13124 | 13124 | int nOut /* Expected output size */ |
| 13125 | 13125 | ){ |
| 13126 | | - u8 *aRes = sqlite3_malloc(nOut); |
| 13126 | + u8 *aRes = sqlite3_malloc64(nOut); |
| 13127 | 13127 | if( aRes==0 ){ |
| 13128 | 13128 | sqlite3_result_error_nomem(pCtx); |
| 13129 | 13129 | }else{ |
| 13130 | 13130 | int err; |
| 13131 | 13131 | z_stream str; |
| | @@ -13518,11 +13518,11 @@ |
| 13518 | 13518 | return SQLITE_OK; |
| 13519 | 13519 | } |
| 13520 | 13520 | |
| 13521 | 13521 | static ZipfileEntry *zipfileNewEntry(const char *zPath){ |
| 13522 | 13522 | ZipfileEntry *pNew; |
| 13523 | | - pNew = sqlite3_malloc(sizeof(ZipfileEntry)); |
| 13523 | + pNew = sqlite3_malloc64(sizeof(ZipfileEntry)); |
| 13524 | 13524 | if( pNew ){ |
| 13525 | 13525 | memset(pNew, 0, sizeof(ZipfileEntry)); |
| 13526 | 13526 | pNew->cds.zFile = sqlite3_mprintf("%s", zPath); |
| 13527 | 13527 | if( pNew->cds.zFile==0 ){ |
| 13528 | 13528 | sqlite3_free(pNew); |
| | @@ -14468,11 +14468,11 @@ |
| 14468 | 14468 | const Bytef *pData = sqlite3_value_blob(argv[0]); |
| 14469 | 14469 | uLong nData = sqlite3_value_bytes(argv[0]); |
| 14470 | 14470 | uLongf nOut = compressBound(nData); |
| 14471 | 14471 | Bytef *pOut; |
| 14472 | 14472 | |
| 14473 | | - pOut = (Bytef*)sqlite3_malloc(nOut); |
| 14473 | + pOut = (Bytef*)sqlite3_malloc64(nOut); |
| 14474 | 14474 | if( pOut==0 ){ |
| 14475 | 14475 | sqlite3_result_error_nomem(context); |
| 14476 | 14476 | return; |
| 14477 | 14477 | }else{ |
| 14478 | 14478 | if( Z_OK!=compress(pOut, &nOut, pData, nData) ){ |
| | @@ -14513,11 +14513,11 @@ |
| 14513 | 14513 | if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){ |
| 14514 | 14514 | sqlite3_result_value(context, argv[0]); |
| 14515 | 14515 | }else{ |
| 14516 | 14516 | uLongf szf = sz; |
| 14517 | 14517 | const Bytef *pData= sqlite3_value_blob(argv[0]); |
| 14518 | | - Bytef *pOut = sqlite3_malloc(sz); |
| 14518 | + Bytef *pOut = sqlite3_malloc64(sz); |
| 14519 | 14519 | if( pOut==0 ){ |
| 14520 | 14520 | sqlite3_result_error_nomem(context); |
| 14521 | 14521 | }else if( Z_OK!=uncompress(pOut, &szf, pData, nData) ){ |
| 14522 | 14522 | sqlite3_result_error(context, "error in uncompress()", -1); |
| 14523 | 14523 | }else{ |
| | @@ -18134,11 +18134,11 @@ |
| 18134 | 18134 | Stmtrand *p; |
| 18135 | 18135 | |
| 18136 | 18136 | p = (Stmtrand*)sqlite3_get_auxdata(context, STMTRAND_KEY); |
| 18137 | 18137 | if( p==0 ){ |
| 18138 | 18138 | unsigned int seed; |
| 18139 | | - p = sqlite3_malloc( sizeof(*p) ); |
| 18139 | + p = sqlite3_malloc64( sizeof(*p) ); |
| 18140 | 18140 | if( p==0 ){ |
| 18141 | 18141 | sqlite3_result_error_nomem(context); |
| 18142 | 18142 | return; |
| 18143 | 18143 | } |
| 18144 | 18144 | if( argc>=1 ){ |
| | @@ -19074,11 +19074,11 @@ |
| 19074 | 19074 | rc = pRoot->xOpen(pRoot, zName, p->pReal, flags, pOutFlags); |
| 19075 | 19075 | vfstraceOnOff(pInfo, VTR_OPEN); |
| 19076 | 19076 | vfstrace_printf(pInfo, "%s.xOpen(%s,flags=0x%x)", |
| 19077 | 19077 | pInfo->zVfsName, p->zFName, flags); |
| 19078 | 19078 | if( p->pReal->pMethods ){ |
| 19079 | | - sqlite3_io_methods *pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 19079 | + sqlite3_io_methods *pNew = sqlite3_malloc64( sizeof(*pNew) ); |
| 19080 | 19080 | const sqlite3_io_methods *pSub = p->pReal->pMethods; |
| 19081 | 19081 | memset(pNew, 0, sizeof(*pNew)); |
| 19082 | 19082 | pNew->iVersion = pSub->iVersion; |
| 19083 | 19083 | pNew->xClose = vfstraceClose; |
| 19084 | 19084 | pNew->xRead = vfstraceRead; |
| | @@ -36326,10 +36326,25 @@ |
| 36326 | 36326 | ShellState *p = (ShellState*)pArg; |
| 36327 | 36327 | cli_puts(z, p->out); |
| 36328 | 36328 | fflush(p->out); |
| 36329 | 36329 | return 1; |
| 36330 | 36330 | } |
| 36331 | + |
| 36332 | +#if defined(SQLITE_DEBUG) && !defined(SQLITE_SHELL_FIDDLE) |
| 36333 | +/* Ensure that sqlite3_reset_auto_extension() clears auto-extension |
| 36334 | +** memory. https://sqlite.org/forum/forumpost/310cb231b07c80d1. |
| 36335 | +** Testing this: if we (inadvertently) remove the |
| 36336 | +** sqlite3_reset_auto_extension() call from main(), most shell tests |
| 36337 | +** will fail because of a leak message in their output. */ |
| 36338 | +static int auto_ext_leak_tester( |
| 36339 | + sqlite3 *db, const char **pzErrMsg, |
| 36340 | + const struct sqlite3_api_routines *pThunk |
| 36341 | +){ |
| 36342 | + (void)db; (void)pzErrMsg; (void)pThunk; |
| 36343 | + return SQLITE_OK; |
| 36344 | +} |
| 36345 | +#endif |
| 36331 | 36346 | |
| 36332 | 36347 | /* Alternative name to the entry point for Fiddle */ |
| 36333 | 36348 | #ifdef SQLITE_SHELL_FIDDLE |
| 36334 | 36349 | # define main fiddle_main |
| 36335 | 36350 | #endif |
| | @@ -36729,10 +36744,13 @@ |
| 36729 | 36744 | if( bEnableVfstrace ){ |
| 36730 | 36745 | vfstrace_register("trace",0,vfstraceOut, &data, 1); |
| 36731 | 36746 | } |
| 36732 | 36747 | #ifndef SQLITE_SHELL_FIDDLE |
| 36733 | 36748 | sqlite3_appendvfs_init(0,0,0); |
| 36749 | +#ifdef SQLITE_DEBUG |
| 36750 | + sqlite3_auto_extension( (void (*)())auto_ext_leak_tester ); |
| 36751 | +#endif |
| 36734 | 36752 | #endif |
| 36735 | 36753 | modeDefault(&data); |
| 36736 | 36754 | |
| 36737 | 36755 | /* Go ahead and open the database file if it already exists. If the |
| 36738 | 36756 | ** file does not exist, delay opening it. This prevents empty database |
| | @@ -37106,10 +37124,11 @@ |
| 37106 | 37124 | ** leaks */ |
| 37107 | 37125 | memset(&data, 0, sizeof(data)); |
| 37108 | 37126 | if( bEnableVfstrace ){ |
| 37109 | 37127 | vfstrace_unregister("trace"); |
| 37110 | 37128 | } |
| 37129 | + sqlite3_reset_auto_extension(); |
| 37111 | 37130 | #ifdef SQLITE_DEBUG |
| 37112 | 37131 | if( sqlite3_memory_used()>mem_main_enter ){ |
| 37113 | 37132 | cli_printf(stderr,"Memory leaked: %u bytes\n", |
| 37114 | 37133 | (unsigned int)(sqlite3_memory_used()-mem_main_enter)); |
| 37115 | 37134 | } |
| 37116 | 37135 | |