diff --git a/src/btree.c b/src/btree.c index c24481bdf7..2fb5becb57 100644 --- a/src/btree.c +++ b/src/btree.c @@ -7242,12 +7242,11 @@ static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){ ** case they are holding a reference to an xFetch reference ** corresponding to page pgnoRoot. */ rc = saveAllCursors(pBt, 0, 0); + releasePage(pPageMove); if( rc!=SQLITE_OK ){ return rc; } - releasePage(pPageMove); - /* Move the page currently at pgnoRoot to pgnoMove. */ rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0, 0); if( rc!=SQLITE_OK ){