From c2ec72d3a037cbefc86e0372411cf9f2429d6161 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 18 Jan 2018 21:05:31 +0100 Subject: [PATCH] Fixed memory leak. Credit to OSS-Fuzz --- MagickCore/compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MagickCore/compress.c b/MagickCore/compress.c index 33160220f..5f4bd8117 100644 --- a/MagickCore/compress.c +++ b/MagickCore/compress.c @@ -460,9 +460,9 @@ MagickExport MagickBooleanType HuffmanDecodeImage(Image *image, (scanline == (unsigned char *) NULL)) { if (mb_hash != (HuffmanTable **) NULL) - mw_hash=(HuffmanTable **) RelinquishMagickMemory(mw_hash); - if (mw_hash != (HuffmanTable **) NULL) mb_hash=(HuffmanTable **) RelinquishMagickMemory(mb_hash); + if (mw_hash != (HuffmanTable **) NULL) + mw_hash=(HuffmanTable **) RelinquishMagickMemory(mw_hash); if (scanline != (unsigned char *) NULL) scanline=(unsigned char *) RelinquishMagickMemory(scanline); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", -- 2.40.0