mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Additional coverage testing. Fix a segfault following OOM in
sqltie3_load_extension(). (CVS 5523) FossilOrigin-Name: f1e44eb323f05495cbae25113aebcc50d16b40df
This commit is contained in:
19
src/vtab.c
19
src/vtab.c
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to help implement virtual tables.
|
||||
**
|
||||
** $Id: vtab.c,v 1.73 2008/08/01 17:37:41 danielk1977 Exp $
|
||||
** $Id: vtab.c,v 1.74 2008/08/02 03:50:39 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
#include "sqliteInt.h"
|
||||
@@ -790,7 +790,11 @@ FuncDef *sqlite3VtabOverloadFunction(
|
||||
}
|
||||
rc = pMod->xFindFunction(pVtab, nArg, zLowerName, &xFunc, &pArg);
|
||||
sqlite3DbFree(db, zLowerName);
|
||||
sqlite3VtabTransferError(db, rc, pVtab);
|
||||
if( pVtab->zErrMsg ){
|
||||
sqlite3Error(db, rc, "%s", pVtab->zErrMsg);
|
||||
sqlite3DbFree(db, pVtab->zErrMsg);
|
||||
pVtab->zErrMsg = 0;
|
||||
}
|
||||
}
|
||||
if( rc==0 ){
|
||||
return pDef;
|
||||
@@ -831,15 +835,4 @@ void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Transfer a virtual table error into the database connection.
|
||||
*/
|
||||
void sqlite3VtabTransferError(sqlite3 *db, int rc, sqlite3_vtab *pVtab){
|
||||
if( pVtab->zErrMsg ){
|
||||
sqlite3Error(db, rc, "%s", pVtab->zErrMsg);
|
||||
sqlite3DbFree(db, pVtab->zErrMsg);
|
||||
pVtab->zErrMsg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SQLITE_OMIT_VIRTUALTABLE */
|
||||
|
Reference in New Issue
Block a user