diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-09-03 11:04:22 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-09-03 11:04:22 +0000 |
commit | fa18bece7a1a530528e149e095775b13cb39bc89 (patch) | |
tree | 503111d31b34f23f3b6d24c9ae112bc954ae542d /src/func.c | |
parent | 369ff42e7713242cd14e3c135857217346454937 (diff) | |
download | sqlite-fa18bece7a1a530528e149e095775b13cb39bc89.tar.gz sqlite-fa18bece7a1a530528e149e095775b13cb39bc89.zip |
Handle transient malloc() failures in sqlite3CreateFunc(). (CVS 4371)
FossilOrigin-Name: c0ce63196458c81e0859fc8a38f2dd2145a580bc
Diffstat (limited to 'src/func.c')
-rw-r--r-- | src/func.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/func.c b/src/func.c index 334dfd9fb..1760626ff 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.173 2007/09/01 17:00:13 danielk1977 Exp $ +** $Id: func.c,v 1.174 2007/09/03 11:04:22 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1133,17 +1133,17 @@ static void test_auxdata( if( zAux ){ zRet[i*2] = '1'; if( strcmp(zAux, z) ){ - free_test_auxdata((void *)zRet); sqlite3_result_error(pCtx, "Auxilary data corruption", -1); return; } - }else{ + }else { zRet[i*2] = '0'; - zAux = contextMalloc(pCtx, strlen(z)+1); - if( zAux ){ - strcpy(zAux, z); - sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata); - } + } + + zAux = contextMalloc(pCtx, strlen(z)+1); + if( zAux ){ + strcpy(zAux, z); + sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata); } zRet[i*2+1] = ' '; } |