Bug 457215 - Fix LCMS memory leak. r=vlad,a191=beltzner
--- a/modules/lcms/src/cmsprecache.c
+++ b/modules/lcms/src/cmsprecache.c
@@ -185,16 +185,22 @@ LCMSBOOL LCMSEXPORT cmsPrecacheProfile(c
break;
default:
// TODO: change non-critical asserts to CMS warnings
CMSASSERT(0); // Not implemented
break;
}
+ // Free the gamma tables
+ if (hasGammaTables) {
+ CMSASSERT(GTables[0] != NULL);
+ cmsFreeGammaTriple(GTables);
+ }
+
// Success
return TRUE;
}
/*
* Frees a Precache structure.
*
* This function is invoked by the refcounting mechanism when the refcount on