Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 17216)
+++ trunk/ippTools/src/camtool.c	(revision 17219)
@@ -352,4 +352,5 @@
     if ((!state) && (!label)) {
         psError(PXTOOLS_ERR_DATA, false, "parameters are required");
+        psFree(where);
         return false;
     }
@@ -358,4 +359,5 @@
         // set chipRun.state to state
         if (!pxcamRunSetStateByQuery(config, where, state)) {
+            psFree(where);
             return false;
         }
@@ -365,7 +367,10 @@
         // set chipRun.label to label
         if (!pxcamRunSetLabelByQuery(config, where, label)) {
-            return false;
-        }
-    }
+            psFree(where);
+            return false;
+        }
+    }
+
+    psFree(where);
 
     return true;
