Commit 4d464d73a for imagemagick.org

commit 4d464d73a6aa9cf6471ed9ba95e872745e656721
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Sun Mar 1 17:22:00 2026 +0100

    Removed unnecessary null checks.

diff --git a/coders/sgi.c b/coders/sgi.c
index 3bf78def6..d9d1e5871 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -1137,10 +1137,8 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
         extent=(2*(size_t) iris_info.columns+10);
         if (HeapOverflowSanityCheck(extent,image->rows) != MagickFalse)
           {
-            if (offsets != (ssize_t *) NULL)
-              offsets=(ssize_t *) RelinquishMagickMemory(offsets);
-            if (runlength != (size_t *) NULL)
-              runlength=(size_t *) RelinquishMagickMemory(runlength);
+            offsets=(ssize_t *) RelinquishMagickMemory(offsets);
+            runlength=(size_t *) RelinquishMagickMemory(runlength);
             ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
           }
         packet_info=AcquireVirtualMemory(extent*image->rows,4*sizeof(*packets));
@@ -1148,10 +1146,8 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
             (runlength == (size_t *) NULL) ||
             (packet_info == (MemoryInfo *) NULL))
           {
-            if (offsets != (ssize_t *) NULL)
-              offsets=(ssize_t *) RelinquishMagickMemory(offsets);
-            if (runlength != (size_t *) NULL)
-              runlength=(size_t *) RelinquishMagickMemory(runlength);
+            offsets=(ssize_t *) RelinquishMagickMemory(offsets);
+            runlength=(size_t *) RelinquishMagickMemory(runlength);
             if (packet_info != (MemoryInfo *) NULL)
               packet_info=RelinquishVirtualMemory(packet_info);
             pixel_info=RelinquishVirtualMemory(pixel_info);