/ Check-in [396ab8f8]
Login

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

Overview
Comment:Fix a potential memory leak following an OOM error in the pragma processing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | est_count_pragma
Files: files | file ages | folders
SHA1: 396ab8f87ea85a01f7cb73aa83d6572057ae97fc
User & Date: drh 2016-12-16 21:02:17
Context
2016-12-16
21:15
Merge the pragma-as-vtab enhancement from trunk. check-in: 89250777 user: drh tags: est_count_pragma
21:02
Fix a potential memory leak following an OOM error in the pragma processing. check-in: 396ab8f8 user: drh tags: est_count_pragma
15:57
Merge recent trunk enhancements. check-in: 74a0ca1f user: drh tags: est_count_pragma
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
  if( iDb<0 ) goto pragma_out;
  pDb = &db->aDb[iDb];

  /* If the temp database has been explicitly named as part of the 
  ** pragma, make sure it is open. 
  */
  if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
    return;
  }

  zLeft = sqlite3NameFromToken(db, pId);
  if( !zLeft ) goto pragma_out;
  if( pValues ) zRight = pValues->a[0].zName;

  assert( pId2 );







|







317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
  if( iDb<0 ) goto pragma_out;
  pDb = &db->aDb[iDb];

  /* If the temp database has been explicitly named as part of the 
  ** pragma, make sure it is open. 
  */
  if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
    goto pragma_out;
  }

  zLeft = sqlite3NameFromToken(db, pId);
  if( !zLeft ) goto pragma_out;
  if( pValues ) zRight = pValues->a[0].zName;

  assert( pId2 );