From 89a132cab90466bd6b791de4512b4cae0aa59c43 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 29 Nov 2018 21:31:35 +0100 Subject: [PATCH] Fixed memory leak that was detected by oss-fuzz. --- coders/psd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/psd.c b/coders/psd.c index 7ca3f5113..4c31d4eec 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -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) -- 2.40.0