1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

Improvements to memory leak detection. The --backtrace=NNN option is now

recognized by tester.tcl.  Memory leak summaries are automatically written
to the file ./memleak.txt and each leak is tagged with the test in which
it occurred.  The quick.test script runs on Linux with no errors and
no leaks. (CVS 4273)

FossilOrigin-Name: 21f6b31097692171c6493e6ca6de6acbd62dc595
This commit is contained in:
drh
2007-08-23 02:47:53 +00:00
parent ed138fb3bc
commit 4a50aac564
20 changed files with 212 additions and 108 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.168 2007/08/21 19:33:56 drh Exp $
** $Id: func.c,v 1.169 2007/08/23 02:47:53 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -807,14 +807,17 @@ static void replaceFunc(
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){
zOut[j++] = zStr[i];
}else{
u8 *zOld;
nOut += nRep - nPattern;
if( nOut>=SQLITE_MAX_LENGTH ){
sqlite3_result_error_toobig(context);
sqlite3_free(zOut);
return;
}
zOld = zOut;
zOut = sqlite3_realloc(zOut, (int)nOut);
if( zOut==0 ){
sqlite3_free(zOld);
return;
}
memcpy(&zOut[j], zRep, nRep);