Bug 723029: Check result code before using the database. r=taras a=akeybl
authorKyle Huey <khuey@kylehuey.com>
Mon, 06 Feb 2012 10:24:42 -0800
changeset 88335 c9fb84b0331eacdeaf36d3c71e10cabb03b8dffe
parent 88334 b577cc1e8d9b105aa8c7ec0a65aa787bf9a1d459
child 88336 3f61c19f697d865995bea8d6fe90bb2e810ace4d
push idunknown
push userunknown
push dateunknown
reviewerstaras, akeybl
bugs723029
milestone12.0a2
Bug 723029: Check result code before using the database. r=taras a=akeybl
storage/src/TelemetryVFS.cpp
--- a/storage/src/TelemetryVFS.cpp
+++ b/storage/src/TelemetryVFS.cpp
@@ -319,16 +319,18 @@ xOpen(sqlite3_vfs* vfs, const char *zNam
       continue;
     char c = match[strlen(h->name)];
     // include -wal/-journal too
     if (!c || c == '-')
       break;
   }
   p->histograms = h;
   rc = orig_vfs->xOpen(orig_vfs, zName, p->pReal, flags, pOutFlags);
+  if( rc != SQLITE_OK )
+    return rc;
   if( p->pReal->pMethods ){
     sqlite3_io_methods *pNew = new sqlite3_io_methods;
     const sqlite3_io_methods *pSub = p->pReal->pMethods;
     memset(pNew, 0, sizeof(*pNew));
     pNew->iVersion = pSub->iVersion;
     pNew->xClose = xClose;
     pNew->xRead = xRead;
     pNew->xWrite = xWrite;