Index: /trunk/ippTools/src/dettool.c
===================================================================
--- /trunk/ippTools/src/dettool.c	(revision 7694)
+++ /trunk/ippTools/src/dettool.c	(revision 7695)
@@ -2051,4 +2051,5 @@
         );
     }
+    psFree(detrendExps);
 
     // start a transaction so we don't end up with an incremented iteration
@@ -2091,5 +2092,5 @@
             return false;
         }
-        psArrayAdd(newInputExps, 0, detInputExpRowAlloc(
+        detInputExpRow *newInputExp = detInputExpRowAlloc(
             (psS32)atol(det_id),
             newIteration,
@@ -2101,5 +2102,7 @@
             inputExp->filter,
             inputExp->stats
-        ));
+        );
+        psArrayAdd(newInputExps, 0, newInputExp);
+        psFree(newInputExp);
     }
     psFree(iter);
@@ -2113,7 +2116,9 @@
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
+            psFree(newInputExps);
             return false;
         }
     }
+    psFree(newInputExps);
 
     // point of no return for det_id creation
