diff options
author | Marti Maria <marti.maria@littlecms.com> | 2022-08-27 11:55:42 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2022-08-27 11:55:42 +0200 |
commit | 908f1ea5871295be31285a3ed412c7ecebdba0f4 (patch) | |
tree | a8069627d3919eb240bcc34cb9407eb72f38ccc8 /src | |
parent | 617f3ae6f95cd448de7b34caef00ff51de4cf57f (diff) | |
download | lcms2-908f1ea5871295be31285a3ed412c7ecebdba0f4.tar.gz |
Fixed a memory leak in case of crafted profile
Free resources accordly when detecting a wrong/crafted profile
Diffstat (limited to 'src')
-rw-r--r-- | src/cmstypes.c | 5 |
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; |