]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid leaving the malloc subsystem in a partially initialized state if
authordrh <drh@noemail.net>
Thu, 26 Mar 2015 17:04:23 +0000 (17:04 +0000)
committerdrh <drh@noemail.net>
Thu, 26 Mar 2015 17:04:23 +0000 (17:04 +0000)
the low-level initialization callback fails.

FossilOrigin-Name: 3e872011ff5e27738c282f46d2b5803d94fe4b76

manifest
manifest.uuid
src/malloc.c

index d6bf4d8b952524ccbf53d4920d60eddee833fd05..2e013a57eb34161249bfd09572ad0cdb3d1a9827 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Provide\ssource\scode\sline\snumbers\sfor\serrors\sin\sthe\sWindows\sVFS\sgenerated\nby\sthe\swinLogIoerr()\sroutine.
-D 2015-03-26T15:27:32.905
+C Avoid\sleaving\sthe\smalloc\ssubsystem\sin\sa\spartially\sinitialized\sstate\sif\nthe\slow-level\sinitialization\scallback\sfails.
+D 2015-03-26T17:04:23.798
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -196,7 +196,7 @@ F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
 F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
 F src/main.c 569d45ba9eb4fbdd631d53f440bcdb4a35ab1505
-F src/malloc.c e818a0db9ac0898f9dc74002f3a5baca32232d05
+F src/malloc.c 6a370b83d54e4bbf6f94021221c2a311cff26a18
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
 F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987
 F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
@@ -1247,7 +1247,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 1688f60c08cc9270948402d98a2333382aa32681
-R 24f2e5bf8513d160bb9262017e93ddbd
+P b5da0d93cd1a3c0917399af3775a32327b883c8e
+R 9e8f7450055b4cee99317e6c8db6583a
 U drh
-Z d3e192564f0add8f7dcb502142bd9b66
+Z af5a15dd737e6e7d08dff92682723060
index fb109a572dccb5f235ef23ffaae21e884de2ca18..22f0d978f9980fc52df4893c2d31869b22e32254 100644 (file)
@@ -1 +1 @@
-b5da0d93cd1a3c0917399af3775a32327b883c8e
\ No newline at end of file
+3e872011ff5e27738c282f46d2b5803d94fe4b76
\ No newline at end of file
index 264d046ec8eb02b382ce04e741eb812f35863fde..f06e27d8465177013b61c3e82fc5d9e9f306ba6e 100644 (file)
@@ -162,6 +162,7 @@ void sqlite3_soft_heap_limit(int n){
 ** Initialize the memory allocation subsystem.
 */
 int sqlite3MallocInit(void){
+  int rc;
   if( sqlite3GlobalConfig.m.xMalloc==0 ){
     sqlite3MemSetDefault();
   }
@@ -197,7 +198,9 @@ int sqlite3MallocInit(void){
     sqlite3GlobalConfig.szPage = 0;
     sqlite3GlobalConfig.nPage = 0;
   }
-  return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
+  rc = sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
+  if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
+  return rc;
 }
 
 /*