6ca8db
diff -up mozilla-esr24/storage/src/Makefile.in.rhbz-1032770 mozilla-esr24/storage/src/Makefile.in
6ca8db
--- mozilla-esr24/storage/src/Makefile.in.rhbz-1032770	2013-10-22 08:19:20.000000000 +0200
6ca8db
+++ mozilla-esr24/storage/src/Makefile.in	2013-12-02 14:33:43.524479615 +0100
6ca8db
@@ -22,14 +22,21 @@ endif
6ca8db
 # Don't use the jemalloc allocator on Android, because we can't guarantee
6ca8db
 # that Gecko will configure sqlite before it is first used (bug 730495).
6ca8db
 #
6ca8db
+# Don't use the jemalloc allocator when using system sqlite. Linked in libraries
6ca8db
+# (such as NSS) might trigger an initialization of sqlite and allocation
6ca8db
+# of memory using the default allocator, prior to the storage service
6ca8db
+# registering its allocator, causing memory management failures (bug 938730).
6ca8db
+#
6ca8db
 # Note: On Windows our sqlite build assumes we use jemalloc.  If you disable
6ca8db
 # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
6ca8db
 # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
6ca8db
 ifdef MOZ_MEMORY
6ca8db
+ifndef MOZ_NATIVE_SQLITE
6ca8db
 ifneq ($(OS_TARGET), Android)
6ca8db
 DEFINES += -DMOZ_STORAGE_MEMORY
6ca8db
 endif
6ca8db
 endif
6ca8db
+endif
6ca8db
 
6ca8db
 # For nsDependentJSString
6ca8db
 LOCAL_INCLUDES = \