Skip to content

Commit

Permalink
eliminate lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 11, 2022
1 parent 8c6731a commit ff3e1f5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions MagickCore/registry.c
Expand Up @@ -452,9 +452,6 @@ static void *DestroyRegistryNode(void *registry_info)
MagickExport MagickBooleanType SetImageRegistry(const RegistryType type,
const char *key,const void *value,ExceptionInfo *exception)
{
MagickBooleanType
status;

RegistryInfo
*registry_info;

Expand Down Expand Up @@ -484,7 +481,8 @@ MagickExport MagickBooleanType SetImageRegistry(const RegistryType type,
*image;

image=(const Image *) value;
if (image->signature != MagickCoreSignature)
if ((image == (const Image *) NULL) ||
(image->signature != MagickCoreSignature))
{
(void) ThrowMagickException(exception,GetMagickModule(),RegistryError,
"UnableToSetRegistry","%s",key);
Expand All @@ -499,7 +497,8 @@ MagickExport MagickBooleanType SetImageRegistry(const RegistryType type,
*image_info;

image_info=(const ImageInfo *) value;
if (image_info->signature != MagickCoreSignature)
if ((image_info == (const ImageInfo *) NULL) ||
(image_info->signature != MagickCoreSignature))
{
(void) ThrowMagickException(exception,GetMagickModule(),RegistryError,
"UnableToSetRegistry","%s",key);
Expand All @@ -526,6 +525,5 @@ MagickExport MagickBooleanType SetImageRegistry(const RegistryType type,
DestroyRegistryNode);
UnlockSemaphoreInfo(registry_semaphore);
}
status=AddValueToSplayTree(registry,ConstantString(key),registry_info);
return(status);
return(AddValueToSplayTree(registry,ConstantString(key),registry_info));
}

0 comments on commit ff3e1f5

Please sign in to comment.