1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix the error message generator for illegal token errors so that it does not

leak memory if it immediately follows another erroneous SQL statement.

FossilOrigin-Name: 3576973f8b88b6109fbefdebfa53468ffa137009
This commit is contained in:
drh
2015-04-15 07:57:27 +00:00
parent 29031837c1
commit 347bdc39a7
3 changed files with 8 additions and 10 deletions

View File

@@ -430,10 +430,8 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
break;
}
case TK_ILLEGAL: {
sqlite3DbFree(db, *pzErrMsg);
*pzErrMsg = sqlite3MPrintf(db, "unrecognized token: \"%T\"",
sqlite3ErrorMsg(pParse, "unrecognized token: \"%T\"",
&pParse->sLastToken);
nErr++;
goto abort_parse;
}
case TK_SEMI: {