Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2022-08-27 12:55:42 +0300
committerMarti Maria <marti.maria@littlecms.com>2022-08-27 12:55:42 +0300
commit908f1ea5871295be31285a3ed412c7ecebdba0f4 (patch)
treea8069627d3919eb240bcc34cb9407eb72f38ccc8
parent617f3ae6f95cd448de7b34caef00ff51de4cf57f (diff)
Fixed a memory leak in case of crafted profile
Free resources accordly when detecting a wrong/crafted profile
-rw-r--r--src/cmstypes.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmstypes.c b/src/cmstypes.c
index 4b7e7ab..1144d98 100644
--- a/src/cmstypes.c
+++ b/src/cmstypes.c
@@ -1550,7 +1550,10 @@ void *Type_MLU_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsU
Block = (wchar_t*) _cmsMalloc(self ->ContextID, SizeOfTag);
if (Block == NULL) goto Error;
NumOfWchar = SizeOfTag / sizeof(wchar_t);
- if (!_cmsReadWCharArray(io, NumOfWchar, Block)) goto Error;
+ if (!_cmsReadWCharArray(io, NumOfWchar, Block)) {
+ _cmsFree(self->ContextID, Block);
+ goto Error;
+ }
}
mlu ->MemPool = Block;