Groupsock uses result of UsageEnvironment::getResultMsg as argument to
UsageEnvironment::setResultMsg which results in corrupted message
(original message is getting lost).
---
 groupsock/Groupsock.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)



-- 
Stas Tsymbalov
TrueConf LLC
http://trueconf.com/
diff --git a/groupsock/Groupsock.cpp b/groupsock/Groupsock.cpp
index 977e40e..10c4008 100644
--- a/groupsock/Groupsock.cpp
+++ b/groupsock/Groupsock.cpp
@@ -284,7 +284,9 @@ Boolean Groupsock::output(UsageEnvironment& env, u_int8_t ttlToSend,
   } while (0);
 
   if (DebugLevel >= 0) { // this is a fatal error
-    env.setResultMsg("Groupsock write failed: ", env.getResultMsg());
+    UsageEnvironment::MsgString msg = strDup(env.getResultMsg());
+    env.setResultMsg("Groupsock write failed: ", msg);
+    delete[] msg;
   }
   return False;
 }
@@ -302,8 +304,9 @@ Boolean Groupsock::handleRead(unsigned char* buffer, unsigned bufferMaxSize,
 			    buffer, maxBytesToRead, fromAddress);
   if (numBytes < 0) {
     if (DebugLevel >= 0) { // this is a fatal error
-      env().setResultMsg("Groupsock read failed: ",
-			 env().getResultMsg());
+      UsageEnvironment::MsgString msg = strDup(env().getResultMsg());
+      env().setResultMsg("Groupsock read failed: ", msg);
+      delete[] msg;
     }
     return False;
   }

_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to