Index: /trunk/psLib/src/sys/psLine.h
===================================================================
--- /trunk/psLib/src/sys/psLine.h	(revision 7846)
+++ /trunk/psLib/src/sys/psLine.h	(revision 7847)
@@ -7,21 +7,44 @@
 #define PS_LINE_H
 
-// structure to carry a dynamic string
+/** Structure to carry a dynamic string */
 typedef struct
 {
-    long NLINE;                 // allocated length
-    long Nline;                 // current length
-    char *line;                 // character string data
+    long NLINE;                        ///< allocated length
+    long Nline;                        ///< current length
+    char *line;                        ///< character string data
 }
 psLine;
 
-// allocate a line object of length Nline
-psLine *psLineAlloc(long Nline);
+/** Allocates a line object of length Nline
+ *
+ *  @return psLine*:        the newly allocated line object.
+*/
+psLine *psLineAlloc(
+    long Nline                         ///<
+);
 
-// (re-)init the line
-bool psLineInit(psLine *line);
+/** Initializes or re-initializes a line.
+ *
+ *  Initializes or re-initializes a line, setting the current length to zero and setting
+ *  the string data values to 0.  If the function is passed NULL, false is returned.
+ *
+ *  @return bool:       True if successful, otherwise false.
+*/
+bool psLineInit(
+    psLine *line                       ///<
+);
 
-// add the new string segment to the line
-bool psLineAdd(psLine *line, const char *format, ...);
+/** Adds the line segment to the string.
+ *
+ *  Appends a line segment to the string, returning false if the new segment would
+ *  overflow the allocated string length.
+ *
+ *  @return bool:        True if successful, otherwise false.
+*/
+bool psLineAdd(
+    psLine *line,                      ///< the line segment to append
+    const char *format,                ///< printf-style format of line
+    ...                                ///< any parameters required in format
+);
 
 #endif /* PS_LINE_H */
Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 7846)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 7847)
@@ -10,6 +10,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-07-07 02:25:54 $
+*  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-07-08 03:17:13 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -616,18 +616,14 @@
     items = template->list->n;
     if(items > 0 ) {
-
         // Allocate metadata
         md = psMetadataAlloc()
              ;
-
         // Point to first item in template
         iter = psListIteratorAlloc(template->
                                    list,PS_LIST_HEAD,true);
-
         // For each item in template parse line string for values
         for(psS32 i = 0;
                 i < items;
                 i++) {
-
             // Get template item
             templateItem = psListGetAndIncrement(iter)
@@ -635,8 +631,8 @@
             if(templateItem == NULL) {
                 psFree(md);
+                psFree(iter);
                 md = NULL;
                 break;
             }
-
             // Get the next token on the line
             token = getToken(&linePtr," ",&status,false);
@@ -648,4 +644,5 @@
                     md = NULL;
                     psFree(token);
+                    psFree(iter);
                     break;
                 }
@@ -656,4 +653,5 @@
                     psFree(mdItem);
                     psFree(token);
+                    psFree(iter);
                     break;
                 }
@@ -662,4 +660,5 @@
                 // Missing items
                 psFree(md);
+                psFree(iter);
                 md = NULL;
                 break;
@@ -668,5 +667,5 @@
             psFree(token);
         }
-        psFree(iter);
+        //        psFree(iter);
     }
     return md;
@@ -1506,4 +1505,5 @@
             psFree(keys);
             psFree(format);
+            psFree(str);
             return NULL;
         }
@@ -1542,4 +1542,5 @@
                 psFree(str);
             }
+            psFree(iter);
         }
         break;
@@ -1804,7 +1805,9 @@
             }
         }
-        psArrayAdd(keys, 0, psStringCopy(item->name));
-    }
-
+        psString string = psStringCopy(item->name);
+        psArrayAdd(keys, 0, string);
+        psFree(string);
+    }
+    psFree(iter);
     return keys;
 }
