From: drh Date: Sat, 17 Sep 2005 18:34:11 +0000 (+0000) Subject: The sqlite3ReallocOrFree routine should set its pointer to NULL when it fails. (CVS... X-Git-Tag: version-3.6.10~3445 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c959118f11c3e45f856afe4cc67440b602fb481;p=thirdparty%2Fsqlite.git The sqlite3ReallocOrFree routine should set its pointer to NULL when it fails. (CVS 2715) FossilOrigin-Name: 0e85af44faca4b625e6ab7cb21a300867298c539 --- diff --git a/manifest b/manifest index b100d0c59f..36461e32a5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sup\sthe\sbusy\stest\sso\sthat\sit\scan\sbe\srun\smultiple\stimes\sin\sa\srow\swithout\ngiving\sfalse\serrors\son\s2nd\sand\ssubsequent\sruns.\s(CVS\s2714) -D 2005-09-17T18:02:37 +C The\ssqlite3ReallocOrFree\sroutine\sshould\sset\sits\spointer\sto\sNULL\swhen\sit\sfails.\s(CVS\s2715) +D 2005-09-17T18:34:11 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -78,7 +78,7 @@ F src/tokenize.c e1faf5637f3f4f90933785a0ecf64595f3ac3530 F src/trigger.c f51dec15921629591cb98bf2e350018e268b109a F src/update.c c2716c2115533ffae3d08bf8853aaba4f970f37e F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c -F src/util.c fa99c441e8ff52c75cde944ea73ea39f6d5a2a09 +F src/util.c 55caaffbb2716f9928ab452d20f3e9cbbeab872d F src/vacuum.c 829d9e1a6d7c094b80e0899686670932eafd768c F src/vdbe.c de007d59f036fcd1b89a7d4172aa0d028e8689eb F src/vdbe.h c8e105979fc7aaf5b8004e9621904e3bd096dfa2 @@ -309,7 +309,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 85b931bf72dac88187e4531053a06abe25d6f462 -R e06416bf38179a505a1d5058330009b8 +P 7a7ba73fb5d1d493dc2c8c0d5ed4ee6d895bb339 +R fe49cfba275f6204d023824f55b6c24a U drh -Z b7dc68036682ab77fc8c822d0f10a916 +Z 18ca71e0f5b02814a15cff809cb10d5b diff --git a/manifest.uuid b/manifest.uuid index d69ddf753c..0e7dddbdbf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7a7ba73fb5d1d493dc2c8c0d5ed4ee6d895bb339 \ No newline at end of file +0e85af44faca4b625e6ab7cb21a300867298c539 \ No newline at end of file diff --git a/src/util.c b/src/util.c index bfeaff1e0e..ba37e0c8a0 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.145 2005/09/16 02:38:11 drh Exp $ +** $Id: util.c,v 1.146 2005/09/17 18:34:11 drh Exp $ */ #include "sqliteInt.h" #include @@ -373,11 +373,10 @@ char *sqlite3StrNDup(const char *z, int n){ */ void sqlite3ReallocOrFree(void **ppBuf, int newSize){ void *pNew = sqliteRealloc(*ppBuf, newSize); - if( pNew ){ - *ppBuf = pNew; - }else{ + if( pNew==0 ){ sqliteFree(*ppBuf); } + *ppBuf = pNew; } /*