Skip to content

Commit fcb2992

Browse files
duiniuluantanqinossrs-ai
authored andcommitted
HLS: Fix a iterator bug in hls_ctx cleanup function. v6.0.182 (#4534)
Co-authored-by: OSSRS-AI <winlinam@gmail.com>
1 parent 54f5048 commit fcb2992

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

trunk/doc/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The changelog for SRS.
77
<a name="v6-changes"></a>
88

99
## SRS 6.0 Changelog
10+
* v6.0, 2025-10-17, Merge [#4534](https://github.com/ossrs/srs/pull/4534): HLS: Fix a iterator bug in hls_ctx cleanup function. v6.0.182 (#4534)
1011
* v6.0, 2025-10-14, Disable sanitizer by default to fix memory leak. (#4364) v6.0.181
1112
* v6.0, 2025-10-01, SRT: Support configurable default_streamid option. v6.0.180
1213
* v6.0, 2025-09-27, For Edge, only support RTMP or HTTP-FLV. v6.0.179 (#4512)

trunk/src/app/srs_app_http_static.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ srs_error_t SrsHlsStream::on_timer(srs_utime_t interval)
355355
srs_error_t err = srs_success;
356356

357357
std::map<std::string, SrsHlsVirtualConn*>::iterator it;
358-
for (it = map_ctx_info_.begin(); it != map_ctx_info_.end(); ++it) {
358+
for (it = map_ctx_info_.begin(); it != map_ctx_info_.end();) {
359359
string ctx = it->first;
360360
SrsHlsVirtualConn* info = it->second;
361361

@@ -370,10 +370,10 @@ srs_error_t SrsHlsStream::on_timer(srs_utime_t interval)
370370
// TODO: FIXME: Should finger out the err.
371371
stat->on_disconnect(ctx, srs_success);
372372

373-
map_ctx_info_.erase(it);
374373
srs_freep(info);
375-
376-
break;
374+
map_ctx_info_.erase(it++);
375+
} else {
376+
++it;
377377
}
378378
}
379379

trunk/src/core/srs_core_version6.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 6
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 181
12+
#define VERSION_REVISION 182
1313

1414
#endif

0 commit comments

Comments
 (0)