Skip to content

Commit fefaaa4

Browse files
committed
Fix a double free on error recovering
1 parent 3d38474 commit fefaaa4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,6 @@ Added some checks for non-happy path, mostly failing mallocs
125125
-----------------------
126126
2.5 Maintenance release
127127
-----------------------
128+
129+
Fixed a double free in recovering from a previous error in default intent handler.
130+

Diff for: src/cmscnvrt.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,9 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
571571
// Concatenate to the output LUT
572572
if (!cmsPipelineCat(Result, Lut))
573573
goto Error;
574+
574575
cmsPipelineFree(Lut);
576+
Lut = NULL;
575577

576578
// Update current space
577579
CurrentColorSpace = ColorSpaceOut;
@@ -581,7 +583,7 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
581583

582584
Error:
583585

584-
cmsPipelineFree(Lut);
586+
if (Lut != NULL) cmsPipelineFree(Lut);
585587
if (Result != NULL) cmsPipelineFree(Result);
586588
return NULL;
587589

0 commit comments

Comments
 (0)