Index: /branches/eam_branch_20071023/psModules/src/config/pmConfig.c
===================================================================
--- /branches/eam_branch_20071023/psModules/src/config/pmConfig.c	(revision 15559)
+++ /branches/eam_branch_20071023/psModules/src/config/pmConfig.c	(revision 15560)
@@ -510,5 +510,4 @@
 
         // Set trace destinations
-        #ifndef PS_NO_TRACE
         argNum = psArgumentGet(*argc, argv, "-tracedest");
         if (argNum > 0) {
@@ -531,5 +530,4 @@
             psWarning("Unable to set log destination to file %d\n", config->traceFD);
         }
-        #endif
 
         // Allow command line options to override defaults for logging.
@@ -553,11 +551,16 @@
 
     psString path = psMetadataLookupStr(NULL, config->site, "PATH");
+    psString newPath = NULL;            // New path
+    // The following gymnastics with 'newPath' are required to avoid changing the pointer out from under the
+    // psMetadataItem on which 'path' sits (leading to memory corruption because it no longer points to valid
+    // memory).
     if (path) {
-        psStringAppend(&path, ":%s", siteNameDir);
+        psStringAppend(&newPath, "%s:%s", path, siteNameDir);
     } else {
-        path = psMemIncrRefCounter(siteNameDir);
-    }
-    pmConfigSet(path);
+        newPath = psMemIncrRefCounter(siteNameDir);
+    }
     psFree(siteNameDir);
+    pmConfigSet(newPath);
+    psFree(newPath);
 
     // Next, we do a similar thing for the camera configuration file.  The
