free sample to prevent memory leak. v5.0.222 (#4305)

修复`SrsRtpRawPayload::copy()`方法中sample_覆盖的问题。

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlinvip@gmail.com>

---------

Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
john 2025-03-21 10:39:57 +08:00
parent 3456fc690e
commit 3df44f8cb2
3 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v5-changes"></a>
## SRS 5.0 Changelog
* v5.0, 2025-03-20, Merge [#4305](https://github.com/ossrs/srs/pull/4305): free sample to prevent memory leak. v5.0.222 (#4305)
* v5.0, 2025-03-18, Merge [#4302](https://github.com/ossrs/srs/pull/4302): update geekyeggo/delete-artifact to 5.0.0. v5.0.221 (#4302)
* v5.0, 2025-02-20, Merge [#4253](https://github.com/ossrs/srs/pull/4253): fix typo about heartbeat. v5.0.220 (#4253)
* v5.0, 2025-02-19, Merge [#4291](https://github.com/ossrs/srs/pull/4291): fix ci error. v5.0.219 (#4291)

View File

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 221
#define VERSION_REVISION 222
#endif

View File

@ -1021,6 +1021,9 @@ ISrsRtpPayloader* SrsRtpRawPayload::copy()
cp->payload = payload;
cp->nn_payload = nn_payload;
// free sample to prevent memory leak.
srs_freep(cp->sample_);
cp->sample_ = sample_->copy();
return cp;