Skip to content

Commit

Permalink
Fixed potential memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jun 19, 2017
1 parent e8fe1ab commit 8c10b92
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions coders/screenshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,16 @@ 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;
if (image == (Image *) NULL)
image=screen;
else
AppendImageToList(&image,screen);
status=SetImageExtent(screen,screen->columns,screen->rows);
if (status == MagickFalse)
{
InheritException(exception,&image->exception);
return(DestroyImageList(image));
}
if (image == (Image *) NULL)
image=screen;
else
AppendImageToList(&image,screen);

bitmapDC=CreateCompatibleDC(hDC);
if (bitmapDC == (HDC) NULL)
Expand Down

0 comments on commit 8c10b92

Please sign in to comment.