Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 7658)
+++ trunk/ippTools/src/dettool.c	(revision 7671)
@@ -172,4 +172,5 @@
     if (!psDBTransaction(config->dbh)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(detrendExps);
         return false;
     }
@@ -193,4 +194,6 @@
     }
 
+    psFree(detrendExps);
+
     for (long i = 0; i < psArrayLength(inputExps); i++) {
         if (!detInputExpInsertObject(config->dbh, inputExps->data[i])) {
@@ -200,7 +203,9 @@
                 psError(PS_ERR_UNKNOWN, false, "database error");
             }
+            psFree(inputExps);
             return false;
         }
     }
+    psFree(inputExps);
 
     // point of no return for det_id creation
