/ Check-in [760072ce]
Login

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

Overview
Comment:Avoid an assertion fault and/or freeing memory while it is still in use when an error occurs during virtual table construction. Cherrypick of [a02599ad85d].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.7.14
Files: files | file ages | folders
SHA1: 760072ceea294fd7d168de28de9e775e545ef30e
User & Date: dan 2013-03-07 11:03:51
Context
2014-10-02
09:27
Fix a segfault that could occur if an 'optimize' command was issued on an FTS table that contained at least one row but zero terms. Leaf check-in: b21746ac user: dan tags: branch-3.7.14
2013-03-07
11:03
Avoid an assertion fault and/or freeing memory while it is still in use when an error occurs during virtual table construction. Cherrypick of [a02599ad85d]. check-in: 760072ce user: dan tags: branch-3.7.14
2012-12-07
04:46
Backport VSIX tooling and packaging fixes and enhancements. check-in: e890bcde user: mistachkin tags: branch-3.7.14
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vtab.c.

   259    259   ** in the list are moved to the sqlite3.pDisconnect list of the associated 
   260    260   ** database connection.
   261    261   */
   262    262   void sqlite3VtabClear(sqlite3 *db, Table *p){
   263    263     if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p);
   264    264     if( p->azModuleArg ){
   265    265       int i;
   266         -    assert( p->nModuleArg<2 || p->azModuleArg[1]==0 );
   267    266       for(i=0; i<p->nModuleArg; i++){
   268         -      sqlite3DbFree(db, p->azModuleArg[i]);
          267  +      if( i!=1 ) sqlite3DbFree(db, p->azModuleArg[i]);
   269    268       }
   270    269       sqlite3DbFree(db, p->azModuleArg);
   271    270     }
   272    271   }
   273    272   
   274    273   /*
   275    274   ** Add a new module argument to pTable->azModuleArg[].