Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix a double free on error recovering
  • Loading branch information
Marti Maria committed Jul 10, 2013
1 parent 3d38474 commit fefaaa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -125,3 +125,6 @@ Added some checks for non-happy path, mostly failing mallocs
-----------------------
2.5 Maintenance release
-----------------------

Fixed a double free in recovering from a previous error in default intent handler.

4 changes: 3 additions & 1 deletion src/cmscnvrt.c
Expand Up @@ -571,7 +571,9 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
// Concatenate to the output LUT
if (!cmsPipelineCat(Result, Lut))
goto Error;

cmsPipelineFree(Lut);
Lut = NULL;

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

Error:

cmsPipelineFree(Lut);
if (Lut != NULL) cmsPipelineFree(Lut);
if (Result != NULL) cmsPipelineFree(Result);
return NULL;

Expand Down

0 comments on commit fefaaa4

Please sign in to comment.