Skip to content

Commit

Permalink
Release resources prior to bailing out of the btreeCreateTable() routine
Browse files Browse the repository at this point in the history
following an OOM error.
  • Loading branch information
D. Richard Hipp committed Apr 3, 2013
1 parent e8b499b commit ba633c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ){
Expand Down

0 comments on commit ba633c5

Please sign in to comment.