[Live-devel] Memory leak report

zhudongjie2023 zhudongjie2023 at 163.com
Wed May 10 09:10:00 PDT 2023


hi all,
    I found a memory leak in version 2023.0303.  The following is my patch, please take a look.


Best Regards,
Jie
----


diff --git a/liveMedia/RTSPServer.cpp b/liveMedia/RTSPServer.cpp
index d649779..1210702 100644
--- a/liveMedia/RTSPServer.cpp
+++ b/liveMedia/RTSPServer.cpp
@@ -493,6 +493,7 @@ void RTSPServer::RTSPClientConnection::handleCmd_notSupported() {
 }


 void RTSPServer::RTSPClientConnection::handleCmd_redirect(char const* urlSuffix) {
+  char *urlPrefix = fOurRTSPServer.rtspURLPrefix(fClientInputSocket);
   snprintf((char*)fResponseBuffer, sizeof fResponseBuffer,
           "RTSP/1.0 301 Moved Permanently\r\n"
           "CSeq: %s\r\n"
@@ -500,7 +501,8 @@ void RTSPServer::RTSPClientConnection::handleCmd_redirect(char const* urlSuffix)
           "Location: %s%s\r\n\r\n",
           fCurrentCSeq,
           dateHeader(),
-          fOurRTSPServer.rtspURLPrefix(fClientInputSocket), urlSuffix);
+          urlPrefix, urlSuffix);
+  delete[] urlPrefix;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230511/e3ab5be9/attachment.htm>


More information about the live-devel mailing list