/ Check-in [653ea15a]
Login

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

Overview
Comment:Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 653ea15ad8e23b333e234eb5dde7b80134db2baf
User & Date: drh 2016-01-16 03:16:19
Context
2016-01-20
15:05
Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC. check-in: b94a3a37 user: drh tags: branch-3.10
2016-01-16
15:12
Use sqlite3VdbeAddOp4() rather than a separate sqlite3VdbeChangeP4() call, for a slightly smaller and faster binary. check-in: a4258cd4 user: drh tags: trunk
03:16
Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC. check-in: 653ea15a user: drh tags: trunk
2016-01-15
21:55
Remove an unnecessary memset(). check-in: 689421a9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2965   2965     /* Enable the lookaside-malloc subsystem */
  2966   2966     setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
  2967   2967                           sqlite3GlobalConfig.nLookaside);
  2968   2968   
  2969   2969     sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
  2970   2970   
  2971   2971   opendb_out:
  2972         -  sqlite3_free(zOpen);
  2973   2972     if( db ){
  2974   2973       assert( db->mutex!=0 || isThreadsafe==0
  2975   2974              || sqlite3GlobalConfig.bFullMutex==0 );
  2976   2975       sqlite3_mutex_leave(db->mutex);
  2977   2976     }
  2978   2977     rc = sqlite3_errcode(db);
  2979   2978     assert( db!=0 || rc==SQLITE_NOMEM );
................................................................................
  3002   3001           iByte = (iByte<<4) + sqlite3HexToInt(zHexKey[i]);
  3003   3002           if( (i&1)!=0 ) zKey[i/2] = iByte;
  3004   3003         }
  3005   3004         sqlite3_key_v2(db, 0, zKey, i/2);
  3006   3005       }
  3007   3006     }
  3008   3007   #endif
         3008  +  sqlite3_free(zOpen);
  3009   3009     return rc & 0xff;
  3010   3010   }
  3011   3011   
  3012   3012   /*
  3013   3013   ** Open a new database handle.
  3014   3014   */
  3015   3015   int sqlite3_open(