Skip to content

Commit

Permalink
Fixed possible memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jan 2, 2022
1 parent 2318bfb commit e5bee23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coders/pnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{ \
if (comment_info.comment != (char *) NULL) \
comment_info.comment=DestroyString(comment_info.comment); \
if (quantum_info != (QuantumInfo *) NULL) \
quantum_info=DestroyQuantumInfo(quantum_info); \
ThrowReaderException((exception),(message)); \
}

Expand Down Expand Up @@ -298,6 +300,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Read PNM image.
*/
quantum_info=(QuantumInfo *) NULL;
count=ReadBlob(image,1,(unsigned char *) &format);
do
{
Expand Down

0 comments on commit e5bee23

Please sign in to comment.