SQLite4
Check-in [9b03a19a30]
Not logged in

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

Overview
Comment:Fix a memory leak in DETACH.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9b03a19a300ba058c0f0015052d9ef82162e5278
User & Date: drh 2013-02-11 16:04:13
Context
2013-02-11
18:33
Fix the data decoder so that it correctly handles +Inf and -Inf. check-in: c04b47fd62 user: drh tags: trunk
16:04
Fix a memory leak in DETACH. check-in: 9b03a19a30 user: drh tags: trunk
15:51
Fix a memory leak in the test harness. check-in: 108d62cab9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/attach.c.

239
240
241
242
243
244
245


246
247
248
249
250
251
252
  if( pDb->pKV->iTransLevel ){
    sqlite4_snprintf(zErr,sizeof(zErr), "database %s is locked", zName);
    goto detach_error;
  }

  sqlite4KVStoreClose(pDb->pKV);
  pDb->pKV = 0;


  pDb->pSchema = 0;
  sqlite4ResetInternalSchema(db, -1);
  return;

detach_error:
  sqlite4_result_error(context, zErr, -1);
}







>
>







239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
  if( pDb->pKV->iTransLevel ){
    sqlite4_snprintf(zErr,sizeof(zErr), "database %s is locked", zName);
    goto detach_error;
  }

  sqlite4KVStoreClose(pDb->pKV);
  pDb->pKV = 0;
  sqlite4SchemaClear(db->pEnv, pDb->pSchema);
  sqlite4DbFree(db, pDb->pSchema);
  pDb->pSchema = 0;
  sqlite4ResetInternalSchema(db, -1);
  return;

detach_error:
  sqlite4_result_error(context, zErr, -1);
}