mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Ensure that an error does not delete the Table object out from under
the xConstruct method of a virtual table. dbsqlfuzz 7cc8804a1c6d4e3d554d79096e6ea75a7c1c7d2d FossilOrigin-Name: df4928c92b0db77d0a40d7b492b609db191252e2f87bca63d000e4fe2e206293
This commit is contained in:
@@ -610,7 +610,9 @@ static int vtabCallConstructor(
|
||||
sCtx.pPrior = db->pVtabCtx;
|
||||
sCtx.bDeclared = 0;
|
||||
db->pVtabCtx = &sCtx;
|
||||
pTab->nTabRef++;
|
||||
rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr);
|
||||
sqlite3DeleteTable(db, pTab);
|
||||
db->pVtabCtx = sCtx.pPrior;
|
||||
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
|
||||
assert( sCtx.pTab==pTab );
|
||||
|
Reference in New Issue
Block a user