Remove an unnecessary malloc from the vfsstat extension.

FossilOrigin-Name: 24f258c2392290168cf34622b89a4a406a3dd853
This commit is contained in:
drh
2016-05-28 17:45:15 +00:00
parent 444c445ff8
commit 66bf810467
3 changed files with 10 additions and 15 deletions
+3 -7
View File
@@ -804,14 +804,10 @@ int sqlite3_vfsstat_init(
const sqlite3_api_routines *pApi
){
int rc = SQLITE_OK;
VStatVfs *pNew;
SQLITE_EXTENSION_INIT2(pApi);
pNew = sqlite3_malloc(sizeof(vstat_vfs));
if( pNew==0 ) return SQLITE_NOMEM;
memcpy(&pNew->base, &vstat_vfs, sizeof(vstat_vfs));
pNew->pVfs = sqlite3_vfs_find(0);
pNew->base.szOsFile = sizeof(VStatFile) + pNew->pVfs->szOsFile;
rc = sqlite3_vfs_register(&pNew->base, 1);
vstat_vfs.pVfs = sqlite3_vfs_find(0);
vstat_vfs.base.szOsFile = sizeof(VStatFile) + pNew->pVfs->szOsFile;
rc = sqlite3_vfs_register(&vstat_vfs.base, 1);
if( rc==SQLITE_OK ){
rc = sqlite3_auto_extension((void(*)(void))vstatRegister);
}