Bug 457215 - Fix LCMS memory leak. r=vlad,a191=beltzner
authorBobby Holley <bholley@cs.stanford.edu>
Fri, 28 Nov 2008 17:26:39 -0800
changeset 22118 fc1c0104ec4dc22c067f48e1e1ceb15fbe4d0f90
parent 22117 f8acae5dc56b95e8b08985ccd7a3070620ab14e4
child 22119 120131b3a0861fc7fed70737e0974f4ddd56b5f4
push idunknown
push userunknown
push dateunknown
reviewersvlad
bugs457215
milestone1.9.1b3pre
Bug 457215 - Fix LCMS memory leak. r=vlad,a191=beltzner
modules/lcms/src/cmsprecache.c
--- 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