Index: trunk/psLib/test/dataManip/tst_psMinimize01.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psMinimize01.c	(revision 1123)
+++ trunk/psLib/test/dataManip/tst_psMinimize01.c	(revision 1177)
@@ -67,4 +67,7 @@
     int i = 0;
     psVector *theParams = NULL;
+    int currentId = psMemGetId();
+    int testStatus = true;
+    int memLeaks = 0;
 
     domain = psImageAlloc(DATA_WIDTH, NUM_DATA, PS_TYPE_F32);
@@ -127,4 +130,8 @@
     data->data.F32[39] = 1.061982;
 
+    printPositiveTestHeader(stdout,
+                            "psMinimize functions",
+                            "psMinimizeChi2(): no masks");
+
     theParams = psMinimizeChi2(myFunc,
                                myFuncDeriv,
@@ -139,5 +146,25 @@
         printf("theParams[%d] is %.1f\n", i, theParams->data.F32[i]);
     }
+    printf("chiSq is %f\n", chiSq);
 
-    printf("chiSq is %f\n", chiSq);
+    psMemCheckCorruption(1);
+    printFooter(stdout,
+                "psMinimize functions",
+                "psMinimizeChi2(): no masks",
+                testStatus);
+    psMemCheckCorruption(1);
+    psFree(domain);
+    psFree(data);
+    psFree(errors);
+    psFree(initialGuess);
+    psFree(paramMask);
+    psFree(tmpVecPtr);
+
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
+    if (0 != memLeaks) {
+        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
+    }
+
+    return (!testStatus);
 }
