diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/alter.c | 5 | ||||
-rw-r--r-- | src/parse.y | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/alter.c b/src/alter.c index 6b0400598..98400c1ad 100644 --- a/src/alter.c +++ b/src/alter.c @@ -970,6 +970,7 @@ static void renameColumnFunc( sParse.nQueryLoop = 1; rc = sqlite3RunParser(&sParse, zSql, &zErr); assert( sParse.pNewTable==0 || sParse.pNewIndex==0 ); + if( db->mallocFailed ) rc = SQLITE_NOMEM; if( rc==SQLITE_OK && sParse.pNewTable==0 && sParse.pNewIndex==0 ){ rc = SQLITE_CORRUPT_BKPT; } @@ -990,8 +991,7 @@ static void renameColumnFunc( sqlite3_result_error_code(context, rc); } sqlite3DbFree(db, zErr); - sqlite3_free(zQuot); - return; + goto renameColumnFunc_done; } if( bQuote ){ @@ -1094,6 +1094,7 @@ static void renameColumnFunc( sqlite3DbFree(db, zOut); } +renameColumnFunc_done: if( sParse.pVdbe ){ sqlite3VdbeFinalize(sParse.pVdbe); } diff --git a/src/parse.y b/src/parse.y index 3e4b60623..47e73feb8 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1311,7 +1311,7 @@ uniqueflag(A) ::= . {A = OE_None;} pIdToken->n, pIdToken->z); } sqlite3ExprListSetName(pParse, p, pIdToken, 1); - if( IN_RENAME_COLUMN ){ + if( IN_RENAME_COLUMN && p ){ sqlite3RenameToken(pParse, (void*)(p->a[p->nExpr-1].zName), pIdToken); } return p; |