From 72a50e400d98d7a2fd610caedfeb9af043dc5582 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 19 Jun 2017 22:59:45 +0200 Subject: [PATCH] Fixed potential memory leak. --- coders/screenshot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coders/screenshot.c b/coders/screenshot.c index e9223c739..e2e6d8605 100644 --- a/coders/screenshot.c +++ b/coders/screenshot.c @@ -165,13 +165,13 @@ static Image *ReadSCREENSHOTImage(const ImageInfo *image_info, screen->columns=(size_t) GetDeviceCaps(hDC,HORZRES); screen->rows=(size_t) GetDeviceCaps(hDC,VERTRES); screen->storage_class=DirectClass; - status=SetImageExtent(screen,screen->columns,screen->rows,exception); - if (status == MagickFalse) - return(DestroyImageList(image)); if (image == (Image *) NULL) image=screen; else AppendImageToList(&image,screen); + status=SetImageExtent(screen,screen->columns,screen->rows,exception); + if (status == MagickFalse) + return(DestroyImageList(image)); bitmapDC=CreateCompatibleDC(hDC); if (bitmapDC == (HDC) NULL) -- 2.40.0