Index: trunk/psLib/src/image/psImageStats.c
===================================================================
--- trunk/psLib/src/image/psImageStats.c	(revision 773)
+++ trunk/psLib/src/image/psImageStats.c	(revision 775)
@@ -20,11 +20,16 @@
 /// This routine must determine the various statistics for the image.
 psStats *
+
 psImageGetStats(const psImage *input,
                 psStats *stats)
 {
     psVector *junk=NULL;
+    psStats *stats2= NULL;
 
     junk = psVectorAlloc(input->numRows * input->numCols, input->type.type);
-    return(psArrayStats(junk, NULL, 0xffffffff, stats));
+    stats2 = psArrayStats(junk, NULL, 0xffffffff, stats);
+    psVectorFree(junk);
+
+    return(stats2);
 }
 
@@ -46,5 +51,5 @@
     Internal Data Structures:
  chebPolys[i][j] 
- 
+        sums[i][j]
  *****************************************************************************/
 psPolynomial2D *
@@ -107,5 +112,5 @@
     }
 
-
+    // GUS: Check the math on this at a later date.
     coeffs->coeff[0][0] = sums[0][0] / (coeffs->nX * coeffs->nY);
     for (i=0;i<coeffs->nX;i++) {
