From 2ab3937a687ba8fac9f79a4bc7bcde6e01d01cb4 Mon Sep 17 00:00:00 2001 From: Jacob Su Date: Sat, 16 Aug 2025 21:56:49 +0800 Subject: [PATCH] fix err memory leak in rtc to rtmp bridge. v6.0.174 (#4441) 1. print the error messages before dismiss it; 2. free the err to avoid memory leak; found this issue when research #4434 . 1. develop 2. 5.0release 3. 6.0release --------- Co-authored-by: winlin --- trunk/doc/CHANGELOG.md | 1 + trunk/src/app/srs_app_rtc_source.cpp | 3 ++- trunk/src/core/srs_core_version6.hpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 2f2adc594..5fa268b82 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 6.0 Changelog +* v6.0, 2025-08-16, Merge [#4441](https://github.com/ossrs/srs/pull/4441): fix err memory leak in rtc to rtmp bridge. v6.0.174 (#4441) * v6.0, 2025-08-14, Merge [#4161](https://github.com/ossrs/srs/pull/4161): fix hls & dash segments cleanup. v6.0.173 (#4161) * v6.0, 2025-08-12, Merge [#4230](https://github.com/ossrs/srs/pull/4230): MP4 DVR: Fix audio/video synchronization issues in WebRTC recordings. v6.0.172 (#4230) * v6.0, 2025-08-11, Merge [#4432](https://github.com/ossrs/srs/pull/4432): AI: HTTP-FLV: Fix heap-use-after-free crash during stream unmount. v6.0.171 (#4432) diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index 43fde7845..85a322130 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -1881,7 +1881,8 @@ srs_error_t SrsRtcFrameBuilder::packet_video_rtmp(const uint16_t start, const ui } if ((err = bridge_->on_frame(&msg)) != srs_success) { - srs_warn("fail to pack video frame"); + srs_warn("fail to pack video frame: %s", srs_error_summary(err).c_str()); + srs_freep(err); } header_sn_ = end + 1; diff --git a/trunk/src/core/srs_core_version6.hpp b/trunk/src/core/srs_core_version6.hpp index 47b66a86f..ea7f3c7c6 100644 --- a/trunk/src/core/srs_core_version6.hpp +++ b/trunk/src/core/srs_core_version6.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 6 #define VERSION_MINOR 0 -#define VERSION_REVISION 173 +#define VERSION_REVISION 174 #endif