From 55195dfdb9ad54b34b0cc9057ac4fab2b142a004 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 15 Oct 2017 10:16:20 +0200 Subject: [PATCH] Removed unnecessary checks for NULL when calling NewSplayTree --- MagickCore/coder.c | 2 -- MagickCore/locale.c | 2 -- MagickCore/magick.c | 3 --- MagickCore/module.c | 3 --- MagickCore/type.c | 2 -- 5 files changed, 12 deletions(-) diff --git a/MagickCore/coder.c b/MagickCore/coder.c index 0eecfedf1..8590731ee 100644 --- a/MagickCore/coder.c +++ b/MagickCore/coder.c @@ -335,8 +335,6 @@ static SplayTreeInfo *AcquireCoderCache(const char *filename, */ cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory, DestroyCoderNode); - if (cache == (SplayTreeInfo *) NULL) - ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) { diff --git a/MagickCore/locale.c b/MagickCore/locale.c index 74cb084b9..6d2100e70 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -194,8 +194,6 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL, DestroyLocaleNode); - if (cache == (SplayTreeInfo *) NULL) - ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) { diff --git a/MagickCore/magick.c b/MagickCore/magick.c index 0df76eace..ee85802d9 100644 --- a/MagickCore/magick.c +++ b/MagickCore/magick.c @@ -1022,9 +1022,6 @@ static MagickBooleanType IsMagickTreeInstantiated(ExceptionInfo *exception) { magick_list=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL,DestroyMagickNode); - if (magick_list == (SplayTreeInfo *) NULL) - ThrowFatalException(ResourceLimitFatalError, - "MemoryAllocationFailed"); #if defined(MAGICKCORE_MODULES_SUPPORT) (void) GetModuleInfo((char *) NULL,exception); #endif diff --git a/MagickCore/module.c b/MagickCore/module.c index 10ee49441..e1aeb8170 100644 --- a/MagickCore/module.c +++ b/MagickCore/module.c @@ -883,9 +883,6 @@ static MagickBooleanType IsModuleTreeInstantiated() splay_tree=NewSplayTree(CompareSplayTreeString, (void *(*)(void *)) NULL,DestroyModuleNode); - if (splay_tree == (SplayTreeInfo *) NULL) - ThrowFatalException(ResourceLimitFatalError, - "MemoryAllocationFailed"); module_info=AcquireModuleInfo((const char *) NULL,"[boot-strap]"); module_info->stealth=MagickTrue; status=AddValueToSplayTree(splay_tree,module_info->tag,module_info); diff --git a/MagickCore/type.c b/MagickCore/type.c index 18ac7d80a..bb4e2e839 100644 --- a/MagickCore/type.c +++ b/MagickCore/type.c @@ -198,8 +198,6 @@ static SplayTreeInfo *AcquireTypeCache(const char *filename, cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL, DestroyTypeNode); - if (cache == (SplayTreeInfo *) NULL) - ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; #if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) { -- 2.40.0