diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-08-16 10:36:33 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-08-16 10:36:33 +0000 |
commit | c6cc77d368bfd84c36cdf264d4c6833025de83d6 (patch) | |
tree | a3b53d0e7c1fefc1ccd8841e39db45cc46696f47 /src | |
parent | 1e5369531e34650f0c1035072f0795da8496ab1a (diff) | |
download | sqlite-c6cc77d368bfd84c36cdf264d4c6833025de83d6.tar.gz sqlite-c6cc77d368bfd84c36cdf264d4c6833025de83d6.zip |
Replace a few sqlite3_malloc() calls that should be sqlite3MallocZero(). (CVS 4234)
FossilOrigin-Name: 384d0ca9bc96309e7057e4a2bd4bac5049485e9b
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 6 | ||||
-rw-r--r-- | src/vdbemem.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/func.c b/src/func.c index c5b2e6cad..b3aa5da80 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.165 2007/08/16 10:09:03 danielk1977 Exp $ +** $Id: func.c,v 1.166 2007/08/16 10:36:34 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1065,7 +1065,7 @@ static void test_destructor( assert( nArg==1 ); if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; len = sqlite3ValueBytes(0, argv[0], ENC(db)); - zVal = sqlite3_malloc(len+3); + zVal = sqlite3MallocZero(len+3); zVal[len] = 0; zVal[len-1] = 0; assert( zVal ); @@ -1109,7 +1109,7 @@ static void test_auxdata( sqlite3_value **argv ){ int i; - char *zRet = sqlite3_malloc(nArg*2); + char *zRet = sqlite3MallocZero(nArg*2); if( !zRet ) return; for(i=0; i<nArg; i++){ char const *z = (char*)sqlite3_value_text(argv[i]); diff --git a/src/vdbemem.c b/src/vdbemem.c index 5d0cc9f7f..53b78c28f 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -884,7 +884,7 @@ const void *sqlite3ValueText(sqlite3 *db, sqlite3_value* pVal, u8 enc){ ** Create a new sqlite3_value object. */ sqlite3_value *sqlite3ValueNew(sqlite3 *db){ - Mem *p = sqlite3_malloc(sizeof(*p)); + Mem *p = sqlite3MallocZero(sizeof(*p)); if( p ){ p->flags = MEM_Null; p->type = SQLITE_NULL; |