Index: trunk/packages/vizservers/geovis/RenderServer.cpp
===================================================================
--- trunk/packages/vizservers/geovis/RenderServer.cpp	(revision 4422)
+++ trunk/packages/vizservers/geovis/RenderServer.cpp	(revision 4424)
@@ -74,9 +74,10 @@
         << " {" << ((view.getSRS() == NULL) ? "" : view.getSRS()->getVertInitString()) << "}"
         << "\n";
-    len = oss.str().size();
-#ifdef USE_THREADS
-    queueResponse(oss.str().c_str(), len, Response::VOLATILE);
+    std::string ostr = oss.str();
+    len = ostr.size();
+#ifdef USE_THREADS
+    queueResponse(ostr.c_str(), len, Response::VOLATILE);
 #else 
-    ssize_t bytesWritten = SocketWrite(oss.str().c_str(), len);
+    ssize_t bytesWritten = SocketWrite(ostr.c_str(), len);
 
     if (bytesWritten < 0) {
@@ -169,12 +170,13 @@
 {
     std::ostringstream oss;
-    oss << "nv>ok -token " << g_stats.nCommands <<  "\n";
-    int nBytes = oss.str().length();
+    oss << "nv>ok -token " << g_stats.nCommands << "\n";
+    std::string ostr = oss.str();
+    int nBytes = ostr.length();
 
     TRACE("Sending OK for commands through %lu", g_stats.nCommands);
 #ifdef USE_THREADS
-    queueResponse(oss.str().c_str(), nBytes, Response::VOLATILE, Response::OK);
-#else
-    if (write(g_fdOut, oss.str().c_str(), nBytes) < 0) {
+    queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::OK);
+#else
+    if (write(g_fdOut, ostr.c_str(), nBytes) < 0) {
         ERROR("write failed: %s", strerror(errno));
         return -1;
Index: trunk/packages/vizservers/geovis/RendererCmd.cpp
===================================================================
--- trunk/packages/vizservers/geovis/RendererCmd.cpp	(revision 4422)
+++ trunk/packages/vizservers/geovis/RendererCmd.cpp	(revision 4424)
@@ -176,9 +176,10 @@
         << " {" << ((view.getSRS() == NULL) ? "" : view.getSRS()->getVertInitString()) << "}"
         << "\n";
-    len = oss.str().size();
+    std::string ostr = oss.str();
+    len = ostr.size();
 #ifdef USE_THREADS
-    queueResponse(oss.str().c_str(), len, Response::VOLATILE);
+    queueResponse(ostr.c_str(), len, Response::VOLATILE);
 #else 
-    ssize_t bytesWritten = SocketWrite(oss.str().c_str(), len);
+    ssize_t bytesWritten = SocketWrite(ostr.c_str(), len);
 
     if (bytesWritten < 0) {
@@ -1187,9 +1188,10 @@
         std::ostringstream path;
         path << "/tmp/tmp" << getpid() << ".earth";
-        FILE *tmpFile = fopen(path.str().c_str(), "w");
+        const char *pathStr = path.str().c_str();
+        FILE *tmpFile = fopen(pathStr, "w");
         fwrite(buf, len, 1, tmpFile);
         fclose(tmpFile);
-        g_renderer->loadEarthFile(path.str().c_str());
-        unlink(path.str().c_str());
+        g_renderer->loadEarthFile(pathStr);
+        unlink(pathStr);
         free(buf);
     } else {
@@ -1844,7 +1846,8 @@
             std::ostringstream oss;
             oss << "nv>viserror -type internal_error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string;
-            nBytes = oss.str().length();
-
-            if (queueResponse(oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) {
+            std::string ostr = oss.str();
+            nBytes = ostr.length();
+
+            if (queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) {
                 return -1;
             }
Index: trunk/packages/vizservers/geovis/Stats.cpp
===================================================================
--- trunk/packages/vizservers/geovis/Stats.cpp	(revision 4422)
+++ trunk/packages/vizservers/geovis/Stats.cpp	(revision 4424)
@@ -101,6 +101,6 @@
 
     int fd = getStatsFile();
-    int result = writeToStatsFile(fd, oss.str().c_str(),
-                                  oss.str().length());
+    std::string ostr = oss.str();
+    int result = writeToStatsFile(fd, ostr.c_str(), ostr.length());
     close(fd);
     return result;
@@ -121,9 +121,9 @@
     keyStream << key << " "
               << getpid();
-
-    TRACE("Stats file key: '%s'", keyStream.str().c_str());
+    std::string keystr = keyStream.str();
+    TRACE("Stats file key: '%s'", keystr.c_str());
 
     md5_init(&state);
-    md5_append(&state, (const md5_byte_t *)keyStream.str().c_str(), keyStream.str().length());
+    md5_append(&state, (const md5_byte_t *)keystr.c_str(), keystr.length());
     md5_finish(&state, digest);
     for (int i = 0; i < 16; i++) {
Index: trunk/packages/vizservers/nanovis/Command.cpp
===================================================================
--- trunk/packages/vizservers/nanovis/Command.cpp	(revision 4422)
+++ trunk/packages/vizservers/nanovis/Command.cpp	(revision 4424)
@@ -2302,8 +2302,9 @@
             std::ostringstream oss;
             oss << "nv>viserror -type internal_error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string;
-            nBytes = oss.str().length();
+            std::string ostr = oss.str();
+            nBytes = ostr.length();
 
 #ifdef USE_THREADS
-            queueResponse(oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR);
+            queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::ERROR);
 #else
             if (write(fdOut, oss.str().c_str(), nBytes) < 0) {
