/ Check-in [a02599ad]
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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a02599ad85d02470c9effa51c02dbda7796bfa16
User & Date: drh 2012-10-09 14:36:47
References
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
Context
2012-10-09
18:51
Attempt to suppress warnings generated by Coverity. check-in: 7b1a6e6c user: drh tags: trunk
14:58
Merge the latest trunk changes, especially the ORDER BY optimizer enhancements but also other fixes, onto the sessions branch. check-in: f1fbb8c5 user: drh tags: sessions
14:36
Avoid an assertion fault and/or freeing memory while it is still in use when an error occurs during virtual table construction. check-in: a02599ad user: drh tags: trunk
09:26
Bring some comments up to date in the query planner, and especially the ORDER BY optimizer. Also add testcase() macros. check-in: bb5c0f1c user: drh tags: trunk
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[].