aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2009-02-17 16:29:10 +0000
committerdanielk1977 <danielk1977@noemail.net>2009-02-17 16:29:10 +0000
commit0a5490715925605759dfa60991f974bcc184d1be (patch)
tree2e83a83699893b8494c0f21f6a6ae532899c8558 /src/malloc.c
parente8df800d4cb57917b4d909678cb467a200120e96 (diff)
downloadsqlite-0a5490715925605759dfa60991f974bcc184d1be.tar.gz
sqlite-0a5490715925605759dfa60991f974bcc184d1be.zip
Allow sqlite3_shutdown() to be called by a process before sqlite3_initialize() is. Prior to this commit such a call could segfault. (CVS 6296)
FossilOrigin-Name: 79431c58d964d6057c7f42f7c1df74f3df4493eb
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c
index a92fae06b..d9c036da6 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -12,7 +12,7 @@
**
** Memory allocation functions used throughout sqlite.
**
-** $Id: malloc.c,v 1.54 2009/01/20 16:53:41 danielk1977 Exp $
+** $Id: malloc.c,v 1.55 2009/02/17 16:29:11 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -153,7 +153,9 @@ int sqlite3MallocInit(void){
** Deinitialize the memory allocation subsystem.
*/
void sqlite3MallocEnd(void){
- sqlite3GlobalConfig.m.xShutdown(sqlite3GlobalConfig.m.pAppData);
+ if( sqlite3GlobalConfig.m.xShutdown ){
+ sqlite3GlobalConfig.m.xShutdown(sqlite3GlobalConfig.m.pAppData);
+ }
memset(&mem0, 0, sizeof(mem0));
}