]> granicus.if.org Git - imagemagick/commitdiff
fix memory leak in hrz
authorroot <356986351@qq.com>
Fri, 15 Sep 2017 16:40:18 +0000 (16:40 +0000)
committerDirk Lemstra <dlemstra@users.noreply.github.com>
Sat, 16 Sep 2017 13:29:09 +0000 (15:29 +0200)
coders/hrz.c

index 948c04ac0d79e501c4b379b174f310e129b2f7ae..19236b82e1a164dbff6ca13433df709ebba01b40 100644 (file)
@@ -154,7 +154,10 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)
   {
     count=ReadBlob(image,length,pixels);
     if ((size_t) count != length)
-      ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+      {
+        pixels=(unsigned char *) RelinquishMagickMemory(pixels);
+        ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+      }
     p=pixels;
     q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
     if (q == (Quantum *) NULL)