Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 17188)
+++ trunk/ippTools/src/chiptool.c	(revision 17219)
@@ -327,4 +327,5 @@
     if ((!state) && (!label)) {
         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
+        psFree(where);
         return false;
     }
@@ -333,4 +334,5 @@
         // set chipRun.state to state
         if (!pxchipRunSetStateByQuery(config, where, state)) {
+            psFree(where);
             return false;
         }
@@ -340,7 +342,10 @@
         // set chipRun.label to label
         if (!pxchipRunSetLabelByQuery(config, where, label)) {
-            return false;
-        }
-    }
+            psFree(where);
+            return false;
+        }
+    }
+
+    psFree(where);
 
     return true;
