Skip to content

Commit a570169

Browse files
chen-guanghuachundonglinlin
authored andcommitted
asan: Fix memory leak in asan by releasing global IPs when run_directly_or_daemon fails. v5.0.154, v6.0.44 (#3541)
- Resolved a memory leak issue in asan when run_directly_or_daemon fails - Previously, global IP lists were not freed, causing asan to report memory leaks - Updated the code to always free global IP lists, regardless of whether run_directly_or_daemon fails or succeeds --------- Co-authored-by: chundonglinlin <[email protected]>
1 parent 33db158 commit a570169

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

trunk/doc/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The changelog for SRS.
88

99
## SRS 5.0 Changelog
1010

11+
* v5.0, 2023-05-13, Merge [#3541](https://github.com/ossrs/srs/pull/3541): asan: Fix memory leak in asan by releasing global IPs when run_directly_or_daemon fails. v5.0.154 (#3541)
1112
* v5.0, 2023-05-12, Merge [#3539](https://github.com/ossrs/srs/pull/3539): WHIP: Improve HTTP DELETE for notifying server unpublish event. v5.0.153 (#3539)
1213
* v5.0, 2023-03-27, Merge [#3450](https://github.com/ossrs/srs/pull/3450): WebRTC: Error message carries the SDP when failed. v5.0.151 (#3450)
1314
* v5.0, 2023-03-25, Merge [#3477](https://github.com/ossrs/srs/pull/3477): Remove unneccessary NULL check in srs_freep. v5.0.150 (#3477)

trunk/src/core/srs_core_version5.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 5
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 153
12+
#define VERSION_REVISION 154
1313

1414
#endif

trunk/src/main/srs_main_server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ srs_error_t do_main(int argc, char** argv, char** envp)
241241
#ifdef SRS_SANITIZER_LOG
242242
__asan_set_error_report_callback(asan_report_callback);
243243
#endif
244-
245-
if ((err = run_directly_or_daemon()) != srs_success) {
246-
return srs_error_wrap(err, "run");
247-
}
248244

245+
err = run_directly_or_daemon();
249246
srs_free_global_system_ips();
247+
if (err != srs_success) {
248+
return srs_error_wrap(err, "run");
249+
}
250250

251251
return err;
252252
}

0 commit comments

Comments
 (0)