Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed potential memory leak.
  • Loading branch information
dlemstra committed Jun 19, 2017
1 parent 0d7e332 commit 72a50e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coders/screenshot.c
Expand Up @@ -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)
Expand Down

0 comments on commit 72a50e4

Please sign in to comment.