From 763c06976a481d16890c6c015026f4fb0731f930 Mon Sep 17 00:00:00 2001 From: alphonsetai Date: Thu, 2 Jan 2020 14:05:06 +0800 Subject: [PATCH 1/2] fix memory leak --- trunk/src/protocol/srs_rtsp_stack.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trunk/src/protocol/srs_rtsp_stack.cpp b/trunk/src/protocol/srs_rtsp_stack.cpp index b939d71785..4d3487ebd4 100644 --- a/trunk/src/protocol/srs_rtsp_stack.cpp +++ b/trunk/src/protocol/srs_rtsp_stack.cpp @@ -161,6 +161,8 @@ void SrsRtpPacket::copy(SrsRtpPacket* src) chunked = src->chunked; completed = src->completed; + + srs_freep(audio_samples); audio_samples = new SrsCodecSample(); } From b5f4b96060b332d9ad8695f4ef572475b617d1ad Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 5 Jan 2020 14:41:31 +0800 Subject: [PATCH 2/2] Merge #1551, fix memory leak in RTSP stack. 2.0.270 --- README.md | 2 ++ trunk/src/core/srs_core.hpp | 2 +- trunk/src/protocol/srs_rtsp_stack.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf04a3a460..ca203c440c 100755 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ Remark: ## History +* v2.0, 2020-01-05, Merge [#1551][bug #1551], fix memory leak in RTSP stack. 2.0.270 * v2.0, 2019-12-26, For [#1488][bug #1488], pass client ip to http callback. 2.0.269 * v2.0, 2019-12-23, Fix [srs-librtmp #22](https://github.com/ossrs/srs-librtmp/issues/22), parse vhost splited by single seperator. 2.0.268 * v2.0, 2019-12-23, Fix [srs-librtmp #25](https://github.com/ossrs/srs-librtmp/issues/25), build srs-librtmp on windows. 2.0.267 @@ -1359,6 +1360,7 @@ Winlin [bug #1312]: https://github.com/ossrs/srs/pull/1312 [bug #1304]: https://github.com/ossrs/srs/pull/1304 [bug #1488]: https://github.com/ossrs/srs/issues/1488 +[bug #1551]: https://github.com/ossrs/srs/pull/1551 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index bb14614002..11ff884182 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 269 +#define VERSION_REVISION 270 // generated by configure, only macros. #include diff --git a/trunk/src/protocol/srs_rtsp_stack.cpp b/trunk/src/protocol/srs_rtsp_stack.cpp index 4d3487ebd4..5552d47718 100644 --- a/trunk/src/protocol/srs_rtsp_stack.cpp +++ b/trunk/src/protocol/srs_rtsp_stack.cpp @@ -162,7 +162,7 @@ void SrsRtpPacket::copy(SrsRtpPacket* src) chunked = src->chunked; completed = src->completed; - srs_freep(audio_samples); + srs_freep(audio_samples); audio_samples = new SrsCodecSample(); }