]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak that was detected by oss-fuzz.
authorDirk Lemstra <dirk@lemstra.org>
Thu, 29 Nov 2018 20:31:35 +0000 (21:31 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Thu, 29 Nov 2018 20:33:20 +0000 (21:33 +0100)
coders/psd.c

index 7ca3f5113bbf8c3047ddb2f03925c9647b337779..4c31d4eecda952d8cbb11aa4750c98fca25354da 100644 (file)
@@ -1608,7 +1608,10 @@ static void AttachPSDLayers(Image *image,LayerInfo *layer_info,
       }
   }
   if (number_layers == 0)
-    return;
+    {
+      layer_info=(LayerInfo *) RelinquishMagickMemory(layer_info);
+      return;
+    }
   for (i=0; i < number_layers; i++)
   {
     if (i > 0)