aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-12-11 14:25:11 +0000
committerdrh <drh@noemail.net>2019-12-11 14:25:11 +0000
commit31046a9f1ff573fc435bf9c5319ec101a91c57c1 (patch)
tree6bb3ca6a8840548f02a3fcb64daeb01132be6f90 /src
parente94006eb4290b428c0fe16b2979540fdcc22a213 (diff)
downloadsqlite-31046a9f1ff573fc435bf9c5319ec101a91c57c1.tar.gz
sqlite-31046a9f1ff573fc435bf9c5319ec101a91c57c1.zip
The xDestroy method of a module might be NULL if the schema is corrupt.
FossilOrigin-Name: 0457e7d1961ab1f63e31d9028a9064a895f5c3fcfb56ba25e4f37e90197e3a9f
Diffstat (limited to 'src')
-rw-r--r--src/vtab.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vtab.c b/src/vtab.c
index e99b20e01..3fcfaea1c 100644
--- a/src/vtab.c
+++ b/src/vtab.c
@@ -892,9 +892,8 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
}
p = vtabDisconnectAll(db, pTab);
xDestroy = p->pMod->pModule->xDestroy;
- assert( xDestroy!=0 ); /* Checked before the virtual table is created */
pTab->nTabRef++;
- rc = xDestroy(p->pVtab);
+ rc = xDestroy ? xDestroy(p->pVtab) : SQLITE_OK;
/* Remove the sqlite3_vtab* from the aVTrans[] array, if applicable */
if( rc==SQLITE_OK ){
assert( pTab->pVTable==p && p->pNext==0 );