OLD | NEW |
(Empty) | |
| 1 diff --git a/third_party/lcms2-2.6/src/cmsxform.c b/third_party/lcms2-2.6/src/cm
sxform.c |
| 2 index eddb9bd..6466d27 100644 |
| 3 --- a/third_party/lcms2-2.6/src/cmsxform.c |
| 4 +++ b/third_party/lcms2-2.6/src/cmsxform.c |
| 5 @@ -593,7 +593,10 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cm
sPipeline* lut, |
| 6 |
| 7 // Allocate needed memory |
| 8 _cmsTRANSFORM* p = (_cmsTRANSFORM*) _cmsMallocZero(ContextID, sizeof(_cmsTR
ANSFORM)); |
| 9 - if (!p) return NULL; |
| 10 + if (!p) { |
| 11 + cmsPipelineFree(lut); |
| 12 + return NULL; |
| 13 + } |
| 14 |
| 15 // Store the proposed pipeline |
| 16 p ->Lut = lut; |
| 17 @@ -643,7 +646,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cms
Pipeline* lut, |
| 18 if (p ->FromInputFloat == NULL || p ->ToOutputFloat == NULL) { |
| 19 |
| 20 cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported
raster format"); |
| 21 - _cmsFree(ContextID, p); |
| 22 + cmsDeleteTransform(p); |
| 23 return NULL; |
| 24 } |
| 25 |
| 26 @@ -673,7 +676,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cms
Pipeline* lut, |
| 27 if (p ->FromInput == NULL || p ->ToOutput == NULL) { |
| 28 |
| 29 cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsuppor
ted raster format"); |
| 30 - _cmsFree(ContextID, p); |
| 31 + cmsDeleteTransform(p); |
| 32 return NULL; |
| 33 } |
| 34 |
OLD | NEW |