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

Never user a pointer to standard library routines malloc() and free().

This rule is to
work around limitations of MSVC and the _fastcall calling convention.
Ticket #1256. (CVS 2473)

FossilOrigin-Name: a39c446726099e4915a1ad72c019d3c2cfe065bb
This commit is contained in:
drh
2005-05-22 20:12:37 +00:00
parent edc1cc5b3e
commit 132d8d6ab9
5 changed files with 23 additions and 14 deletions

View File

@@ -15,7 +15,7 @@
** individual tokens and sends those tokens one-by-one over to the
** parser for analysis.
**
** $Id: tokenize.c,v 1.101 2005/02/26 17:31:27 drh Exp $
** $Id: tokenize.c,v 1.102 2005/05/22 20:12:37 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -341,7 +341,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
db->flags &= ~SQLITE_Interrupt;
pParse->rc = SQLITE_OK;
i = 0;
pEngine = sqlite3ParserAlloc((void*(*)(int))malloc);
pEngine = sqlite3ParserAlloc((void*(*)(int))sqlite3MallocX);
if( pEngine==0 ){
sqlite3SetString(pzErrMsg, "out of memory", (char*)0);
return 1;
@@ -401,7 +401,7 @@ abort_parse:
}
sqlite3Parser(pEngine, 0, pParse->sLastToken, pParse);
}
sqlite3ParserFree(pEngine, free);
sqlite3ParserFree(pEngine, sqlite3FreeX);
if( sqlite3_malloc_failed ){
pParse->rc = SQLITE_NOMEM;
}