From 0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:18:09 +0200 Subject: Merging upstream version 115.9.0esr. Signed-off-by: Daniel Baumann --- xpcom/build/XPCOMInit.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xpcom') diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index cd6c7f7052..61e29ababd 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -164,11 +164,19 @@ class ICUReporter final : public nsIMemoryReporter, NS_DECL_ISUPPORTS static void* Alloc(const void*, size_t aSize) { - return CountingMalloc(aSize); + void* result = CountingMalloc(aSize); + if (result == nullptr) { + MOZ_CRASH("Ran out of memory while allocating for ICU"); + } + return result; } static void* Realloc(const void*, void* aPtr, size_t aSize) { - return CountingRealloc(aPtr, aSize); + void* result = CountingRealloc(aPtr, aSize); + if (result == nullptr) { + MOZ_CRASH("Ran out of memory while reallocating for ICU"); + } + return result; } static void Free(const void*, void* aPtr) { return CountingFree(aPtr); } -- cgit v1.2.3