From e5bee2335ec13cff0171e9517f862298bb7f0c0a Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 2 Jan 2022 11:45:29 +0100 Subject: [PATCH] Fixed possible memory leak. --- coders/pnm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coders/pnm.c b/coders/pnm.c index 20ecad5cf4..5c35b2259b 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -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)); \ } @@ -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 {