Index: /trunk/Ohana/src/opihi/lib.shell/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/ConfigInit.c	(revision 42937)
+++ /trunk/Ohana/src/opihi/lib.shell/ConfigInit.c	(revision 42938)
@@ -22,7 +22,8 @@
 }
 
-// this function is only called at shutdown, so it is not thread protect
+// this function is only called at shutdown, so it is not thread safe
 void ConfigFree () {
   if (GlobalConfig) free (GlobalConfig);
+  FreeConfigFile (); // frees the config variable structures
   return;
 }
Index: /trunk/Ohana/src/opihi/lib.shell/command.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/command.c	(revision 42937)
+++ /trunk/Ohana/src/opihi/lib.shell/command.c	(revision 42938)
@@ -36,5 +36,6 @@
   /* solve math expresions, assign variable, if needed.  any entry in line of the form {foo}
    * returns value or tmp vector / buffer */
-  line = parse (&status, line);        /* line is freed here, new one allocated */
+  line = parse (&status, line);
+  /* NOTE: line is freed here, new one allocated.  This is NOT freed by the 'quit' command */
   if (!status) goto escape;
 
@@ -42,4 +43,5 @@
   *outline = line;
   
+  // this value is not freed by 'quit' (called as command below)
   argv = parse_commands (line, &argc);
   if (argc == 0) {
@@ -50,4 +52,5 @@
 
   /* save the original values of argv since command may modify the array */
+  // this value is not freed by 'quit' (called as command below)
   ALLOCATE (targv, char *, argc);
   for (i = 0; i < argc; i++) targv[i] = argv[i];
Index: /trunk/Ohana/src/opihi/lib.shell/gprint.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 42937)
+++ /trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 42938)
@@ -93,4 +93,16 @@
 
   pthread_mutex_unlock (&init_stream_mutex);
+}
+
+// call just before exiting opihi-based programs
+void gprintFree () {
+  for (int i = 0; i < Nstreams; i++) {
+    FreeIOBuffer (streams[i][0].buffer);
+    FREE (streams[i][0].buffer);
+    FREE (streams[i][0].name);
+    FREE (streams[i]);
+  }
+  FREE (streams);
+  return;
 }
 
