Index: /trunk/Ohana/src/opihi/cmd.basic/run_for.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_for.c	(revision 16463)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_for.c	(revision 16464)
@@ -38,5 +38,5 @@
 
     /* check for end-of-data syntax error */
-    if (input == (char *) NULL) {
+    if (input == NULL) {
       if (ThisList == 0)  {
 	gprint (GP_ERR, "end loop with 'END'\n");
@@ -59,5 +59,8 @@
     if (!strncasecmp (input, "END", 3)) {
       depth --;
-      if (depth < 0) break;
+      if (depth < 0) { 
+	free (input);
+	break;
+      }
     }
 
@@ -74,5 +77,4 @@
 
   /* cleanup loop data */
-  free (input);
   loop.Nlines = i;
   REALLOCATE (loop.line, char *, MAX (loop.Nlines, 1));
